Description of problem: When I tried to upload a zip file of a Publican-based book, the uploader failed with a message that "The ZIP file did not contain a publican.cfg file." The Zip files did contain a publican.cfg file; however the directory containing the book's XML was named incorrectly ("xml" instead of "en-US") Version-Release number of selected component (if applicable): How reproducible: 100% Steps to Reproduce: 1. Create a Zip file containing a Publican-based book, including its Publican.cfg file, but with the XML directory misnamed. 2. Select "Publican" as the input source 3. (keep clicking "Next", accepting defaults" 4. Attempt to upload the Zip file you created Actual results: Import stops with error "The ZIP file did not contain a publican.cfg file." Expected results: PressGang reports that it can't find the XML directory that's specified by the "xml_lang:" parameter in the publican.cfg file. Additional info:
The message has been changed to "The ZIP file did not contain a publican.cfg file in the root folder of the ZIP archive."
I get that error message now when the publican.cfg is in another directory. However renaming the "en-US" directory to "xml" produces no error and just gives me an empty list. Additionally from the empty list I can click next and it continues without any problem.
Created attachment 881198 [details] publican zip file with invalid source dir
When no files are found in the language dir, an error message is displayed.
Fixed in 201404011324
I got the error message: The source ZIP file has no XML files under the en-US directory. However this indicates that the directory exists when it in fact doesn't, so we should probably use the above when no XML files are found in the xml_lang directory, and use something like Cannot find the en-US directory in the supplied source ZIP.
Fixed in 201404020837 Different messages are produce if the directory is missing, and if it is empty.
I now get different errors, however the error makes me restart the entire import which is annoying. Additionally it doesn't look like importing from a directory works any more on Chrome, as I just keep getting the following error: The source ZIP file has no en-US directory.
The API that interacts with the file system uses slightly different filenames for a directory than the library the reads zip files. The logic that checks to see if the directory exists now accounts for this difference.
The fix for the incorrect empty directory message is live in 201404021320.
Fixed in 201404021340 When a zip file or directory is selected without the required files, you are prevented from continuing instead of the import process restarting.
Verified