I just ran Drupal's update, after installing Imagepicker 6.x-2.x-dev (release of April 23) . It gave me the White Screen. This was the error I got:
Fatal error: Call to undefined function imagepicker_user_has_role() in E:\mysite\sites\all\modules\imagepicker\contribs\imagepicker_postlet\imagepicker_postlet.module on line 407
But upon restarting my site (Drupal 6.20, on localhost), I could continue without a problem. So, I don't know if this actually means anything (apart from a second of panic).
BTW: the inclusion of the insert template (in the .example file) works like a Charm! Thanks so very very much!!
Comments
Comment #1
hutch commentedThanks for the bug report, I will need to revisit postlet code ;-(
Comment #2
hutch commentedComment #3
csc4 commentedThis is marked as fixed - but with the 2011-Dec-23 version on running update.php I'm getting
- is it really fixed?
I can see the function - imagepicker.functions.inc(2836): function imagepicker_user_has_role($role, $user=NULL) {
So what's different about running update which stops it being visible to imagepicker_postlet.module?
Digging some more - noticed in imagepicker_postlet_init
I'm running update as user 0 - is it as simple as that condition?
Comment #4
hutch commentedDoes commenting out the if condition so that the module_load_include() functions always run solve your problem?
I take it that "running update as user 0" means you are using drush...
Comment #5
csc4 commentedThanks for reply.
When I say user 0 - I mean I'm running a straight update.php as the first installed user. No Drush.
I haven't been able to run a successful update.php so I'm very puzzled I'm the only one who seems to have this problem.
In desperation to get update.php running successfully again I've tried some more digging and changing line 419 of imagepicker_postlet.module from
to
Has stopped the errors so far.
Still feel it isn't quite the right answer though - as clearly at the time imagepicker_postlet_check_ok() is being called after an update the function imagepicker_user_has_role isn't defined?
Comment #6
hutch commentedYour solution allows admin (user id 1) through as $postlet_ok default is TRUE. It still filters logged in users which is what we want without checking user 1's roles (which we don't want, user 1 should have access to everything no matter what)
I will commit this shortly.
Probably the reason I did not see this error is because I gave my user 1 the relevant role(s) in testing. I don't use it in production at all.
To be honest I haven't given postlet much attention, I am wary of tools that upload outside of Drupal's control mechanisms which is why I have not ported it to Drupal 7.
Comment #7
ahillio commentedI was unable to uninstall imagepicker_postlet. Drush was telling me
Error: Call to undefined function imagepicker_user_has_role() in imagepicker_postlet.module line 419.I changed the code according to #5 (since it was shorter than #6) and was able to successfully uninstall.
Thank you.