Islandora-Collaboration-Group / islandora_webform

islandora_webform
GNU General Public License v3.0
6 stars 8 forks source link

Missing fedora object PID error message appears all content pages #32

Open patdunlavey opened 8 years ago

patdunlavey commented 8 years ago

[Using Islandora HEAD modules and IW cloned today 2016-02-02.]

Originally reported by @petermacdonald here: #29

On the Islandora site where I have configured two Webforms, all anonymous users (not an administrator) now see the following red error message at the top of Drupal's content window on all pages:

X - No fedora object PID was defined.

That message is coming from the islandora_webform_module, line 228.

I'll try to get rid of it if you have any ideas for me to try. Thanks.

See screen capture attached.

62a1dd62-c9ce-11e5-859a-9644c8914a92

patdunlavey commented 8 years ago

@petermacdonald I am not able to reproduce this. This function should only execute when trying to determine if the user has access to a webform and if that webform has a 'islandora_object_pid' component. Can you think of some way your site would be trying to display a webform in this context? Is a webform or webform link displayed when you are logged in as an administrator?

petermacdonald commented 8 years ago

I found the problem, Pat.

I had made a Drupal Block that used a Menu with a link that had the following in the Path box:

Path: node/3/webform-results/table

This was apparently trying to execute the Webform at every Drupal page load and the Webform module was throwing that error.

When I removed that link from the Menu, I no longer got the " No fedora object PID was defined."

This is okay with me. I can live without that link.

Thanks for looking into it though, Pat.

patdunlavey commented 8 years ago

Thanks for the update @petermacdonald.

Do you think it would make sense for my access check to not throw that error message? It was an attempt to be helpful - to explain why you are being denied permission to see this. But most access denied results are not explained through an error message - for good reason: it's confusing to the non-administrative user.

I could make it throw a message into watchdog instead. Do you think that makes sense?

petermacdonald commented 8 years ago

Pat,

I don't mind the reminder, but if the reminder could just go to the watchdog it wouldn't intrude into anonymous users' use of the software. Or can you make it apprear to just to user's of an admin account. Either way would work for me.

Peter

On Wednesday, February 3, 2016, Pat Dunlavey notifications@github.com wrote:

Thanks for the update @petermacdonald https://github.com/petermacdonald.

Do you think it would make sense for my access check to not throw that error message? It was an attempt to be helpful - to explain why you are being denied permission to see this. But most access denied results are not explained through an error message - for good reason: it's confusing to the non-administrative user.

I could make it throw a message into watchdog instead. Do you think that makes sense?

— Reply to this email directly or view it on GitHub https://github.com/commonmedia/islandora_webform/issues/32#issuecomment-179508273 .

Peter MacDonald, Library Information Systems Specialist Hamilton College Library Clinton, New York 315 859-4493 pmacdona-hamilton (Skype)