Islandora-Collaboration-Group / islandora_webform

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

Selecting "add webform link:" Returns an AJAX Error #7

Closed McFateM closed 9 years ago

McFateM commented 9 years ago

I installed the latest IW master code last week and this morning I created my first webform to mimic the old transcription/captioning process that we've been using here at Grinnell. When I try to enable the new form on my transcription test object I get the following response...

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: /islandora_webform/2124886/tagobject/test%3A21183/ajax?destination=islandora/object/test%3A21183&tok=XgNOstfpCXF3S3qZA7Ws1eSf5J77Itwy-oZ9VSNgKbw StatusText: OK ResponseText: Notice: Array to string conversion in strtr() (line 115 of /var/www/drupal7/modules/syslog/syslog.module). => / /_ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ ul.krumo-node { margin: 0px; padding: 0px; } ul.krumo-node ul { margin-left: 20px; }

A check of my Drupal logs shows this final entry...

TYPE debug DATE Tuesday, June 30, 2015 - 11:01 USER System Admin LOCATION https://digitalx.grinnell.edu/islandora_webform/2124886/tag_object/test%3A21183/ajax?destination=islandora/object/test%3A21183&tok=XgNOstfpCXF3S3qZA7Ws1eSf5J77Itwy-oZ9VSNgKbw REFERRER https://digitalx.grinnell.edu/islandora/object/test:21183 MESSAGE tag SEVERITY debug HOSTNAME 132.161.216.200 OPERATIONS

Any suggestions for dealing with this? Thanks in advance.

DiegoPino commented 9 years ago

Hi @McFateM , I have my doubts about the "master" branch. I can still see some old commits that got fixed/or overridden long time ago by new ones in the bitbucket version (like debug statement, mostly dpm ). Like this one https://github.com/commonmedia/islandora_webform/commit/9e52aeb837d0f789fd637bd227ddeba9142f18a5, which was a intermediate state of our development and has a lot of debug code there. @patdunlavey , can you cheek if the merge and migration to github did not left some commits/fixes/code clean up out? I sense there is some old code there. And debug functions are well known to interfere in Ajax.

patdunlavey commented 9 years ago

@DiegoPino You may be on to something. We are pushing to the github repo now, and bitbucket should not be used, but I'm not sure if we may have gotten out of sync and missed some commits in the transition. We also need to do some tidying up with our branch names so that it's clear which is the release branch. The error @McFateM is seeing is not with ajax, per se. It's just an error that occurs during an ajax call, so ajax reports it instead of the regular drupal message box. The proximal error is that there is a variable which is not an array which the function (watchdog) expects to be an array. But I suspect that it not being an array is a problem - period. I.e. just getting rid of the debug code won't fix it. I will have some time to look at this in the next day or so.

McFateM commented 9 years ago

OK, I just pulled the testing branch into my development box and now things appear to be working properly. I am still getting some notices back when the form opens though...

Notice: Undefined index: webform_ajax in islandora_webform_form_webform_client_form_alter() (line 179 of /var/www/drupal7/sites/default/modules/contrib/islandora_webform/islandora_webform.module). => ... (Array, 16 elements) Krumo version 0.2.1a | http://krumo.sourceforge.net Click to expand. Double-click to show path. Called from /var/www/drupal7/sites/default/modules/contrib/islandora_webform/islandora_webform.module, line 179
Notice: Use of undefined constant WEBFORM_AJAX_NO_AJAX - assumed 'WEBFORM_AJAX_NO_AJAX' in islandora_webform_form_webform_client_form_alter() (line 179 of /var/www/drupal7/sites/default/modules/contrib/islandora_webform/islandora_webform.module). =>

DiegoPino commented 9 years ago

@McFateM , WEBFORM_AJAX_NO_AJAX not present means you don't have the webform_ajax module installed. I assume the first error is related to the same problem.

https://www.drupal.org/project/webform_ajax

The version i have working here is : 7.x-1.1

patdunlavey commented 9 years ago

I'm pretty sure we changed this so that webform_ajax was not a dependency - it just would not give you the ajax link option if it was not present. That testing branch is very out of date, probably before I made that change.

McFateM commented 9 years ago

Oops, had it downloaded but never enabled. Thanks!

-Mark

From: Diego Pino Navarro notifications@github.com<mailto:notifications@github.com> Reply-To: commonmedia/islandora_webform reply@reply.github.com<mailto:reply@reply.github.com> Date: Tuesday, June 30, 2015 at 12:59 PM To: commonmedia/islandora_webform islandora_webform@noreply.github.com<mailto:islandora_webform@noreply.github.com> Cc: Mark McFate mcfatem@grinnell.edu<mailto:mcfatem@grinnell.edu> Subject: Re: [islandora_webform] Selecting "add webform link:" Returns an AJAX Error (#7)

@McFateMhttps://github.com/McFateM , WEBFORM_AJAX_NO_AJAX not present means you don't have the webform_ajax module installed. I assume the first error is related to the same problem.

https://www.drupal.org/project/webform_ajax

The version i have working here is : 7.x-1.1

Reply to this email directly or view it on GitHubhttps://github.com/commonmedia/islandora_webform/issues/7#issuecomment-117283869.

McFateM commented 9 years ago

Which branch should I be testing against?

-Mark

From: Pat Dunlavey notifications@github.com<mailto:notifications@github.com> Reply-To: commonmedia/islandora_webform reply@reply.github.com<mailto:reply@reply.github.com> Date: Tuesday, June 30, 2015 at 1:07 PM To: commonmedia/islandora_webform islandora_webform@noreply.github.com<mailto:islandora_webform@noreply.github.com> Cc: Mark McFate mcfatem@grinnell.edu<mailto:mcfatem@grinnell.edu> Subject: Re: [islandora_webform] Selecting "add webform link:" Returns an AJAX Error (#7)

I'm pretty sure we changed this so that webform_ajax was not a dependency - it just would not give you the ajax link option if it was not present. That testing branch is very out of date, probably before I made that change.

Reply to this email directly or view it on GitHubhttps://github.com/commonmedia/islandora_webform/issues/7#issuecomment-117287047.

patdunlavey commented 9 years ago

Ay there's the rub: https://github.com/commonmedia/islandora_webform/issues/7#issuecomment-117268532

patdunlavey commented 9 years ago

In theory, this should be what everybody is working from: https://github.com/commonmedia/islandora_webform/releases/tag/RC1

patdunlavey commented 9 years ago

@McFateM I just did a bit of testing with RC1, turning webform_ajax on and off, and also looking at that code where you were seeing the error, and it all seems right to me. Can you switch to that release (if you haven't already) and tell me if the problem you were seeing remains?

McFateM commented 9 years ago

I moved to 7.x-1.4-rc1 about 30 minutes ago and have been doing more testing. Created a new test object and tried the "add webform link" but again got the following AJAX error...

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: /islandora_webform/2124886/tagobject/test%3A21184/ajax?destination=islandora/object/test%3A21184&tok=TmV6LPy-By6o6U7i4nqIdi1xH4SPgK-IkzZUTIHOrFY StatusText: OK ResponseText: Notice: Array to string conversion in strtr() (line 115 of /var/www/drupal7/modules/syslog/syslog.module). => / /_ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ ul.krumo-node { margin: 0px; padding: 0px; } ul.krumo-node ul { margin-left: 20px; }

-Mark

From: Pat Dunlavey notifications@github.com<mailto:notifications@github.com> Reply-To: commonmedia/islandora_webform reply@reply.github.com<mailto:reply@reply.github.com> Date: Tuesday, June 30, 2015 at 1:33 PM To: commonmedia/islandora_webform islandora_webform@noreply.github.com<mailto:islandora_webform@noreply.github.com> Cc: Mark McFate mcfatem@grinnell.edu<mailto:mcfatem@grinnell.edu> Subject: Re: [islandora_webform] Selecting "add webform link:" Returns an AJAX Error (#7)

@McFateMhttps://github.com/McFateM I just did a bit of testing with RC1, turning webform_ajax on and off, and also looking at that code where you were seeing the error, and it all seems right to me. Can you switch to that release (if you haven't already) and tell me if the problem you were seeing remains?

Reply to this email directly or view it on GitHubhttps://github.com/commonmedia/islandora_webform/issues/7#issuecomment-117294225.

McFateM commented 9 years ago

Oops, I forgot to mention that even though the AJAX error was generated I do now have a "Transcribe this Object" link on my object display page.

patdunlavey commented 9 years ago

Ok, I think I need more info to reproduce this error. Are you available on skype @McFateM? (I'm patdunlavey)

McFateM commented 9 years ago

Sent a Go-to-Meeting email to you moments ago...

-Mark

From: Pat Dunlavey notifications@github.com<mailto:notifications@github.com> Reply-To: commonmedia/islandora_webform reply@reply.github.com<mailto:reply@reply.github.com> Date: Tuesday, June 30, 2015 at 2:01 PM To: commonmedia/islandora_webform islandora_webform@noreply.github.com<mailto:islandora_webform@noreply.github.com> Cc: Mark McFate mcfatem@grinnell.edu<mailto:mcfatem@grinnell.edu> Subject: Re: [islandora_webform] Selecting "add webform link:" Returns an AJAX Error (#7)

Ok, I think I need more info to reproduce this error. Are you available on skype @McFateMhttps://github.com/McFateM? (I'm patdunlavey)

Reply to this email directly or view it on GitHubhttps://github.com/commonmedia/islandora_webform/issues/7#issuecomment-117304780.

patdunlavey commented 9 years ago

Don't see it yet...

McFateM commented 9 years ago

OK, had a look at this with Pat's help (Thank You Patrick!) and we commented out two "watchdog" calls in my copy of the RC1 code. That did the trick. The AJAX errors are gone now.

Pat: I will leave it to you to follow-up on this thread if you like, or just close this issue at your leisure.

Thanks again. Take care.

patdunlavey commented 9 years ago

I think the reason @McFateM saw the problem and I did not is most likely due to differing php version and/or error strictness setting for php. I removed the offending debug statement and am pretty sure that there is no further issue here. I updated RC1 with this change.