Active
Project:
Document Import API
Version:
6.x-2.0-alpha1
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
9 Jul 2008 at 00:05 UTC
Updated:
10 Jul 2008 at 14:12 UTC
Trying to follow the directions at http://docapi-demo.deviantsolutions.net/node/1 to upload a jpg.
I'm trying to upload http://drupal.org/files/soc08-198x128_white.jpg at node/add/doc and once submitted I get a WSOD.
Comments
Comment #1
bradfordcp commentedI have uploaded the image to both my demo dev site without any issues. Where dd you try to upload it? Is there anything in your error log?
Thanks!
Comment #2
bradfordcp commentedComment #3
agentrickardI never got a WSOD either, which is weird. I had some other errors that were based on some UNIX permissions that I had to adjust, but no WSOD.
Comment #4
webchickI'm on localhost. It's a MAMP install.
When I tried it in Safari, I got:
Safari can’t open the page.
Safari can’t open the page “http://localhost/soc6x/node/add/doc”. The error was: “Operation could not be completed. (kCFErrorDomainCFNetwork error 302.)” (kCFErrorDomainCFNetwork:302) Please choose Report Bugs to Apple from the Safari menu, note the error number, and describe what you did before you saw this message.
My guess is it's something to do with #280112: Errors when enabling the module.
Comment #5
agentrickardcpbradford and I had a long look at this in IRC.
Very likely. There is also a weird (core bug) issue with the use of hook_enable().
If you enable both the core DocAPI module and the plugin at the same time, Drupal executes the plugin enable hook _first_ before the main module is active, so the implementation of hook_enable() fails to register the plugin.
I had to enable the DocAPI module, and then enable the plugin.
I call this a core bug because modules with dependencies should not be installed before the module they depend on. I think the issue is in module_enable().
Comment #6
webchickAh, I did indeed enable both at once. But even when enabling one first and then the other, it still fails.
I get two of these in watchdog after:
The directory docapi_library indeed doesn't exist. The files directory is writable, however. So I'm guessing on hook_enable/hook_install ought to create this directory for me, or... something.
Comment #7
agentrickardYup.
@bradfordcp
For reference, here is a similar function used in the MySite module. It tries to create an upload directory:
http://therickards.com/api/function/mysite_icon_folder_check/MySite
$path here is defined as:
In your case, $folder == 'docapi_library' on initialization, and might be changed by the user later.
You can run this routine on docapi_enable(). I would run it again on the DocAPI configuration page, and return an error if there is a problem.