Closed (duplicate)
Project:
Drupal core
Version:
7.2
Component:
file.module
Priority:
Critical
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
6 Dec 2010 at 11:05 UTC
Updated:
9 Jul 2011 at 05:31 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
juxelle commentedI get the same error with a fresh install of drupal 7rc4.
- fresh install
- create article
- select "create new book"
gives the error message
Comment #2
droplet commented#1008046: error & wrong message when create a new book from non-book content type
Comment #3
droplet commentedComment #4
timhilliard commentedHi guys I've tracked down this problem. it was with file.module and in the file_managed_file_validate validate hook it was still using the legacy 'clicked_button' array key in the $form_state variable. For legacy drupal does set the 'clicked_button' variable but in this instance it did not as the ajax event was not triggered by a click. This conversely meant that the 'clicked_button' variable in the array was not there and triggering the error. To fix this I have created a patch that replaces the 'clicked_button' array key to 'triggered_element' instead and also changes the $clicked_button variable to $triggered_element to better represent the variable.
Comment #6
droplet commentedabove patch worked. try follow patch for testbots
Comment #7
timhilliard commentedRe-rolled patch as I hadn't created the patch from the root drupal directory. Submitting for retesting.
Comment #8
droplet commentedComment #9
webchickLet's get a test for this.
Comment #10
rfayDo you mind if we make this a duplicate of #1049462: Usage of deprecated $form_state['clicked_button'] causes bugs during AJAX submissions by non-buttons? It fixes this globally.
Comment #11
timhilliard commentedMakes sense to me. Looks like this problem occurs in more than just the place we have found here.
Comment #12
Wappie08 commentedActually the thread rfay mentioned is now 8.x related, so I think it is ok to reopen this thread to fix this in 7.x asap.
Actually I'm not able to make a new book at all (the content type is in the books allowed list) so I think this is actually critical then!
Warning: end() [function.end]: Passed variable is not an array or object in file_managed_file_validate() (line 536
will try the above patch later on.
Comment #13
Wappie08 commentedsorry, screwed up the tags..
Comment #14
arlinsandbulte commentedstill considered a duplicate of #1049462: Usage of deprecated $form_state['clicked_button'] causes bugs during AJAX submissions by non-buttons
Policy is that all D7 bugs need to be first fixed in D8 and then back ported to D7 (if applicable).
The eliminates regressions in D8.
I have tagged #1049462 with 'needs backport to D7'
Comment #15
kisugiai commentedits still in 7.2
why?
-.-
Comment #16
Anonymous (not verified) commentedsame issue
Comment #17
libre fan commentedsame issue since D 7.2.
Comment #18
elgandoz commentedstill exist
Comment #19
arlinsandbulte commentedHey people (#15-18), if you would pay attention here you would notice that this issue was marked a duplicate of another issue where this is being addressed:
#1049462: Usage of deprecated $form_state['clicked_button'] causes bugs during AJAX submissions by non-buttons
That issue was fixed, but may not yet be part of the most recent Drupal release. Commits were made to both Drupal 7 & 8. Here are the commit details:
D7.x: http://drupalcode.org/project/drupal.git/commit/2c01d05
D8.x: http://drupalcode.org/project/drupal.git/commit/c0bfd27
Furthermore, if you would have paid attention to the correct issue (#1049462) instead of this duplicate, you would have noticed that webchick said this fix is not available in the 7.4 release, but you will need to either wait for the 7.5 release or use the current -dev:
http://drupal.org/node/1049462#comment-4702154
I encourage you to test the -dev to verify that #1049462 did indeed fix this issue.