I'm on Drupal 7.22 and using Mollom 7.x-2.7 without any problems. Very recently I've added some webforms and went into Mollom Content Moderation with the intention of changing a few of my forms from text analysis to captcha.
Research has shown that this has come up in Mollom before but I can't see a fix.
I get a pink box at the top of the Mollom content moderation screen with the below notices.
Can anyone suggest a fix for this
Notice: Trying to get property of non-object in node_mollom_form_info() (line 3200 of /nfs/c01/h14/mnt/12661/domains/in-cnc.com/html/sites/all/modules/mollom/mollom.module).
Notice: Trying to get property of non-object in node_mollom_form_info() (line 3208 of /nfs/c01/h14/mnt/12661/domains/in-cnc.com/html/sites/all/modules/mollom/mollom.module).
Notice: Trying to get property of non-object in node_mollom_form_info() (line 3213 of /nfs/c01/h14/mnt/12661/domains/in-cnc.com/html/sites/all/modules/mollom/mollom.module).
Notice: Trying to get property of non-object in node_mollom_form_info() (line 3217 of /nfs/c01/h14/mnt/12661/domains/in-cnc.com/html/sites/all/modules/mollom/mollom.module).
Notice: Undefined index: article in mollom_form_info_add_fields() (line 1006 of /nfs/c01/h14/mnt/12661/domains/in-cnc.com/html/sites/all/modules/mollom/mollom.module).
Notice: Undefined index: blog in mollom_form_info_add_fields() (line 1006 of /nfs/c01/h14/mnt/12661/domains/in-cnc.com/html/sites/all/modules/mollom/mollom.module).
Notice: Undefined index: page in mollom_form_info_add_fields() (line 1006 of /nfs/c01/h14/mnt/12661/domains/in-cnc.com/html/sites/all/modules/mollom/mollom.module).
Notice: Undefined index: webform in mollom_form_info_add_fields() (line 1006 of /nfs/c01/h14/mnt/12661/domains/in-cnc.com/html/sites/all/modules/mollom/mollom.module).
Notice: Undefined index: forum in mollom_form_info_add_fields() (line 1006 of /nfs/c01/h14/mnt/12661/domains/in-cnc.com/html/sites/all/modules/mollom/mollom.module).
Comment | File | Size | Author |
---|---|---|---|
#3 | mollom.orphan-forms.3.patch | 4.65 KB | sun |
Comments
Comment #1
Didier Misson CreditAttribution: Didier Misson commentedI have the same problem on Drupal 7.23 and Mollom 7.x-2.7 ...
Thanks.
Didier
Comment #2
sunSorry for the delay.
This notice appears, because one or more node/content types that previously existed, no longer exist. Most likely, because the content types were renamed or deleted.
As of now, the Mollom module does not have a mechanism for detecting the rename or deletion of a protected form. Thus, the configured forms are still the same, and it tries to retrieve information for the form that was previously protected.
Since it is borderline impossible to implement a generic mechanism for reacting to all renamed and deleted forms that may be provided by other modules (that integrate with Mollom), we should implement a mechanism to automatically remove stale/orphan form configurations.
And of course, the concrete offender of
node_mollom_form_info()
obviously needs to be adjusted to check whether the requested node type actually exists, before trying to operate further on it. :)Comment #3
sunAttached patch implements a slightly more defensive approach — it fixes the warnings and notices, but only marks affected forms as "orphan" in the administrative list.
I did not want to automatically delete orphan entries, since the site administrator would not be aware of those deletions otherwise. (I also consider a warning message as insufficient, since Drupal still does not support persistent messages that need to be acknowledged; thus, if the wrong user happens to hit the page, the information would be lost.)
Are you able to test this patch on your site?
Comment #4
Didier Misson CreditAttribution: Didier Misson commentedI apply the patch :
I clear the cache.
I go on the "Mollom moderation page" :
Ok, ALL error messages disappear.
(no "orphan" message...)
Thanks,
Comment #5
sunSorry, further investigation revealed that this has the same root cause as #804466: Orphan forms of other modules cause errors on administration page
Thus, merging this issue (+ patch) into that one.