Failure to sync source file when project is created
Status: Beta
Brought to you by:
worden
Lee Worden is confused, could have sworn there was a ticket for this one. Opening a duplicate, maybe. When you create a new project by introducing a source file into a fresh page and previewing, the first time it adds the file to the project and fails to make, and the next time you preview it makes correctly.
Anonymous
It adds the file in
WWInterface::render_after_parsing(). That function goes in 2 passes now, in order to do the adding of new files before the syncing, and it works, except when the project is not yet created. Why should that make a difference?In the first pass, for each tag it loads the project and adds the file to it if needed:
In second pass, it loops through all the tags and does, for each one,
So what's different about projects that don't have saved descriptions?
find_project_by_name()creates an empty project if there's no description, and render_after_parsing should add to it and use it the same as any other, andproject_is_modified()causes it to eventually be saved to the wiki - if it didn't we'd be adding the file again the next time we preview.I am doing some logging, and so far:
add_source_file()it already has the tex file listed as a project file with no info attached - what's up with that?I've been assuming that it was failing to sync the tex file, but apparently that's not actually the problem.
Hmm, so
WorkingWikiProjectDescription::__construct()actually has a special case:which seems like it must be the source of the problem. If creating an empty project and then adding a source file to it gives you a project with no GNUmakefile, but creating one with a file in it gives you one with a GNUmakefile, what purpose does this serve exactly?
Maybe it's so that it won't add GNUmakefile and save the project description just because someone tried to look at whether the project exists?
But initializing it with an automatic makefile wouldn't cause it to get saved to the wiki...
All the discussion I archived while I was implementing the GNUmakefile thing, at [#356], is encyclopedic and interesting, but doesn't shed any light on why I thought brand-new projects should be prevented from having a GNUmakefile.
I'm tempted to just add it, but I'm worried about not knowing whether there's a reason for not doing it. What should I test once it's added?
Related
Bugs: #356
OK I checked all those things in the code, and they seem robust to this change. So I'll make it and poke around the wiki for troubles.
Guess I'll leave it like this.
Committed in r1047.