Fields gone after submission.

asak - February 8, 2008 - 09:15
Project:Comment CCK
Version:5.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

It seems like comment cck is deleting all of my fields which aren't mandatory after submitting a comment.
even without changing the comment fields.

once disabling this module, i can submit comments and all fields are kept.

#1

chrislynch - June 5, 2008 - 23:12

I have the same problem. My site is reporting an issue with field group module?

#2

Gerhard Killesreiter - June 7, 2008 - 16:50

can you try the 5.x-1.x version and see if this fixes it?

#3

chrislynch - June 8, 2008 - 12:33

The fields are no longer blanked out, but the update that I want to apply doesn't apply either.

Three new error messages now appear when adding a comment to a node and trying to change one of that node's fields

* warning: Invalid argument supplied for foreach() in D:\WOS\www\ipred\modules\node\node.module on line 521.
* warning: implode() [function.implode]: Bad arguments. in D:\WOS\www\ipred\modules\node\node.module on line 525.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE in D:\WOS\www\ipred\includes\database.mysql.inc on line 172.

#4

chrislynch - June 8, 2008 - 12:45

Did some more testing on this.

The errors (above) are because we are passing something duff into node_load. I changed this and hardcoded in a nid.

This fixed the errors(above), but although the field I wanted to update was updated, the fields that were node in the list of fields to be updated by adding a comment were lost as before.

#5

chrislynch - June 9, 2008 - 10:11

OK, I think I can see what is wrong with this. There seems to be a well documented issue with calling node_save on CCK nodes and losing data as a result.

http://drupal.org/node/217824

#6

chrislynch - June 10, 2008 - 06:36
Status:active» postponed (maintainer needs more info)

Hi there,

Any objections to me changing this so that it does this using elements of the CCK API?

You could pick up enough data using the techniques from this page to perform SQL write-backs, or there might be something in the API specifically for saving a field?

I think the downside would be a loss of versioning on the node, but we would retain the history of changes as output in the comments?

Cheers,

Chris

#7

deviantintegral - November 29, 2008 - 02:45

This is strange - I don't have this problem on 1.0, but was as of today's -dev build. I'd switched to the development version as I wanted fieldgroup support. In my case, every field would become empty except for the nodereference field set to multiple, which would become shortened by one.

--Andrew

#8

opensanta - May 8, 2009 - 21:29
Version:5.x-1.0» 6.x-1.0-beta1

Please try the latest release.

#9

drewish - May 19, 2009 - 22:17

mitchell, if this was only reported as a 5.x bug why did you bump it to 6.0? do you have any reason to suspect it affect that branch?

#10

opensanta - May 22, 2009 - 04:06
Version:6.x-1.0-beta1» 5.x-1.0
Status:postponed (maintainer needs more info)» closed

@drewish: That's a good point. A lot of issues made sense to move from 5.x to 6.x, but I've never experienced this bug and this seems like one I wouldn't have missed.

Closing to clean up old bug reports.

 
 

Drupal is a registered trademark of Dries Buytaert.