Closed (fixed)
Project:
Mollom
Version:
5.x-1.8
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Jun 2008 at 21:24 UTC
Updated:
14 Aug 2010 at 22:20 UTC
Jump to comment: Most recent file
When using Mollom with a CCK node type, I get the following PHP warning when I submit a node:
warning: Cannot use a scalar value as an array in /var/www/dev.indymedia.be/trunk/sites/all/modules/cck/content.module on line 606.
The content is submitted fine though.
Not sure if this report belongs in CCK's issue queue. Since the warning disappears when disabling Mollom, I'm posting it here.
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | mollom-DRUPAL-5.node-data.17.patch | 1.1 KB | sun |
| #16 | 271339.mollom.php-warnings-link-module.patch | 923 bytes | joachim |
Comments
Comment #1
brunodboI'm not sure if this report belongs in CCK's or Mollom's issue queue. Anyone?
Comment #2
yched commentedHard to tell. That error means the node that gets rendered has something like $node->field_foo == 'a string', instead of the expected array of values.
Does this happens only after submitting the node ? Or even when simply viewing it ? (please also try 'simply viewing' after emptying the cache)
If it's only on node submit, then something's wrong during the phase where mollom renders the node to send it to the service.
You could try altering mollom_data_node_form() in this way (you need devel.module, obviously), so that we can have more info on what's happening :
..
$data = node_build_content((object)$form_values, FALSE, FALSE);
dsm($data); // <-- add this line
$content = drupal_render($data->content);
Comment #3
brunodboThe warning only appears on a node submit. I'm pasting the output of dsm($data); underneath:
Comment #4
karens commentedIt looks like the Link module is adding some unexpected values to the node. I'd say this might be a Link module issue. Moving it there so they can investigate.
Comment #5
yched commentedRight, the entry for field_link seem very likely to produce the error.
Comment #6
quicksketchLink module cleans up it's own mess, but I think that Mollom is just getting a shot at the submitted data before Link does. Perhaps Mollom's submit handler could be run after CCK runs the "process form data" hook? Here's Link trying to clean up it's information:
But if Mollom runs before CCK calls Link to do the cleanup, I'm not sure that there's anything Link can do. I'll push it over to the Mollom queue. Let me know if there's something to do about it on the Link side.
Comment #7
AdrianB commentedI was hit by this as well when I activated a Link field on a Drupal 5.9 installation with Mollom. When I disabled Mollom the error message disappeared. (Another way of saying "subscribing".)
Comment #8
brunodboI investigated this some more ...
- The warning only appears when the Link field is multivalue (and when Mollom is enabled).
- On another node type with a multivalue Link field, I also get the following warning (on top of the 'scalar value' warning mentioned above, and only with Mollom enabled):
I'm moving this back to Link field. If I shouldn't have, please move it back to Mollom's queue.
Comment #9
brunodboActually moving it to Link ...
Comment #10
quicksketchOnce again (as noted in #6), link.module is doing every thing it can to clean up its information. I think it's Mollom that's causing the problem.
Comment #11
brunodboUpdating title.
Comment #12
dave reidStill a problem in the current version?
Comment #13
sunI guess this is fixed now, because we no longer invoke Mollom's validation functions during form processing.
Thanks for reporting though! The improvement will be available in the next official release.
Comment #15
joachim commentedThis is still a problem in 5.
Comment #16
joachim commentedHere is a patch on the CVS 5 branch.
Comment #17
sunThis can easily end in infinite recursion -- node form validation invokes mollom node form validation handler, which invokes node_validate(), which invokes node form validation.
That's a bit too hot, I think. Let's apply a stop-gap fix here.
Can you test attached patch, please? Works for me. We are about to create one last Drupal 5 release in the next days.
Powered by Dreditor.
Comment #18
sunI actually tested this patch manually, so I know it works, hence, RTBC.
Comment #19
dries commentedI haven't tested the patch but I'm happy to trust sun's testing. :)
It's quite a hack but I'm OK with it as it is D5 only.
Committed to the DRUPAL-5 branch.