Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
actions.inc will sometimes try to access a nonexistent array key, causing a notice:
WD php: Notice: Undefined index: configurable in actions_synchronize() (line 323 of includes/actions.inc).
Comment | File | Size | Author |
---|---|---|---|
#11 | drupal-actions-985814-11-D7.patch | 879 bytes | mikeytown2 |
#8 | drupal-actions-985814-8-D7.patch | 859 bytes | mikeytown2 |
#6 | drupal-actions-985814-6-D7.patch | 630 bytes | mikeytown2 |
#4 | drupal-actions-985814-4-D6.patch | 666 bytes | mikeytown2 |
#2 | actions-985814-d6.patch | 658 bytes | joshuajabbour |
Comments
Comment #1
joshuajabbour CreditAttribution: joshuajabbour commentedd7 patch
Comment #2
joshuajabbour CreditAttribution: joshuajabbour commentedd6 backport
Comment #3
mikeytown2 CreditAttribution: mikeytown2 commented#2 works for 6.x.
Comment #4
mikeytown2 CreditAttribution: mikeytown2 commentedUpdated #2 patch for git
Comment #6
mikeytown2 CreditAttribution: mikeytown2 commentedRedo #1 for test bot.
Comment #7
rogical CreditAttribution: rogical commentedissue still existed after applying patch (occur on enabling a rules featrue):
Comment #8
mikeytown2 CreditAttribution: mikeytown2 commented@rogical
That is most likely an issue with some code that implements hook_action_info(). In any case I've modified the patch so accommodate your issue as well.
Comment #9
rogical CreditAttribution: rogical commentedThis time it works, thanks!
Comment #10
filijonka CreditAttribution: filijonka commentedThis patch won't solve the first error message cause empty doesn't check if the index exists. And that is what the error message says.
Comment #11
mikeytown2 CreditAttribution: mikeytown2 commentedcheck to make sure an array was passed in.
Comment #12
filijonka CreditAttribution: filijonka commentedcould we please try to find out why this errormessage exists? Just because it says undefined index doesn't mean that we should check that this index is set (which no patch is doing). We should ask why the index isn't set.
So we need information how to reproduce this error.
Comment #13
rogical CreditAttribution: rogical commentedI encountered this error during enable user points module, it was solved with patch at #11, thanks!
Notice: Undefined index: type in actions_synchronize() (line 292 of /opt/development/yourhelps/includes/actions.inc).
Notice: Undefined index: configurable in actions_synchronize() (line 282 of /opt/development/yourhelps/includes/actions.inc).
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'type' cannot be null: INSERT INTO {actions} (aid, type, callback, parameters, label) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => help_c2c_action_delete [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => help_c2c_action_delete [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => Delete help c2c entities when referenced node was deleted ) in actions_synchronize() (line 297 of /opt/development/yourhelps/includes/actions.inc).
Comment #14
filijonka CreditAttribution: filijonka commentedhi
this isn't tested by the community; there's no test here.
I'm setting this to needs review so perhaps someone else can take a look at the patch.
My opinion mentioned in #12 stands; the patch isn't solving the error and we need steps to reproduce this error.
Comment #15
aaronschachter CreditAttribution: aaronschachter commentedi was getting this error once i added my own hook_action_info() in a custom module. found this thread and then this one: http://drupal.org/node/1566090.
i didn't define 'configurable' in my hook_action_info() - once i did, the error stopped.
Comment #16
filijonka CreditAttribution: filijonka commentedthanks @aaron.
I think we safely can say that this isn't because of an error in core but when contributed modules isn't doing the right things..
Comment #17
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedThis might be related to the following issue:
http://drupal.org/node/883944#comment-5986304
in essence a module is not defining all items needed for actions.module
Comment #18
Dave ReidYes, this problem definitely means a contrib module is not implementing the hook correctly.
Comment #19
DrupalDan CreditAttribution: DrupalDan commentedI got the same problem after installing and enabling one module, but I don't know how to fix this. Can anyone share some solutions?
@Dave Reid, if this problem means a module is not implementing the hook correctly, what do you think the cause could be, I mean, the cause of "not implementing the hook correctly". Do you think it could be a db problem?
Thanks
Comment #20
malc0mn CreditAttribution: malc0mn commented@19: this simply means that if the module you enabled does something like this:
in
hook_action_info()
you will see this error. Change it to something like this:to fix the problem and log an issue in the module's issue queue for the maintainer to fix it.
Comment #21
jjmackow CreditAttribution: jjmackow commentedAlong the same lines as #19 though, is there a way to determine what the offending module is?
In Drupal 7.18, I'm receiving this error at line 282, and when I look at the code within the 'actions_synchronize' function, its reasonable to see that the issue has to do with the 'configurable' key from the passed array.
But what would be the best way of trapping the call that is causing the error message.
Thanks.
k
Comment #22
DaPooch CreditAttribution: DaPooch commentedWhile it's true that contrib modules should implement this properly, I still think it's a good idea to do the check if possible to avoid raising a notice. Of the 9 modules I have that implement hook_action_info() only 5 of them properly declare the 'configurable' value. Not a great attention to detail with the API I'll admit, but obviously it's a common mistake.
Comment #23
malc0mn CreditAttribution: malc0mn commentedI would think that the default value for configurable would be FALSE. That is the most logical approach and the least confusing. It's a bit like hook_menu() and MENU_NORMAL_ITEM imho: