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.
Hi I'm getting the following error with the image button:
user warning: Column 'field_domain_setup_help_value' cannot be null query: INSERT INTO content_type_website (vid, nid, field_theme_nid, field_domain_hosting_value, field_hosting_name_value, field_hosting_link_url, field_hosting_link_title, field_hosting_link_attributes, field_domain_setup_help_value) VALUES (207, 207, 114, NULL, NULL, NULL, NULL, NULL, NULL) in /Applications/MAMP/htdocs/drupal/sites/all/modules/cck/content.module on line 1213.
I have an image button field called 'field_domain_setup_help'
The error pops up whenever I try to save a content type with the image button field in it. I'm assuming that it's trying to save a value to the database, when the image button shouldn't have any values saved to the node.
Thanks for your help in advance. :)
Comments
Comment #1
BassistJimmyJam CreditAttribution: BassistJimmyJam commentedThis was a fun one to track down but I believe I have resolved the issue in revision 328634. This will be made available in the next development snapshot. Please let me know if you continue to have any issues, and thanks for all your bug reports. It has been a big help getting this module closer to a more stable release.
Comment #2
bluestarstudios CreditAttribution: bluestarstudios commentedYou are a genius! ;)
Problem fixed. Thanks a lot. And it's a pleasure helping out in this. You've created a really fun and useful module. So thanks!
Take care!
Comment #3
bluestarstudios CreditAttribution: bluestarstudios commentedok. back again.
so, yes you managed to fix the problem, bo now we got a new one. Now neither of the button types are showing up on the add/edit pages of all content types. They do however show up on the node view pages. What's strange though is the buttons do show up on edit pages of previously saved nodes... So something went wrong in that last code change. :)
Also it seems that only HTML buttons are accessible through Views fields. Any way of adding Image buttons in there too?
Thanks so much!
Comment #4
BassistJimmyJam CreditAttribution: BassistJimmyJam commentedI had a condition so that the field won't be rendered if there is no node id. However, a node is not assigned a node id until after the add form has been saved. I removed this restriction and added some help text to inform people that Rules that require the node won't work on add forms.
It appears that a field must have a database column in order to appear in views. I have updated the module to create these settings, please make sure you run update.php after updating the module.
Comment #5
bluestarstudios CreditAttribution: bluestarstudios commentedSo I ran the update, and unfortunately got a Failure:
Tried again manually, and no success. So now saving nodes gives me the following error, which is obvious due to the new structure...
user warning: Unknown column 'field_domain_setup_help_value' in 'field list' query: INSERT INTO content_type_website (vid, nid, field_theme_nid, field_change_theme_bttn_value, field_domain_hosting_value, field_hosting_name_value, field_hosting_link_url, field_hosting_link_title, field_hosting_link_attributes, field_domain_setup_help_value) VALUES (208, 208, 138, NULL, NULL, NULL, NULL, NULL, NULL, NULL) in /Applications/MAMP/htdocs/drupal/sites/all/modules/cck/content.module on line 1213.
Any tips?
Comment #6
BassistJimmyJam CreditAttribution: BassistJimmyJam commentedI have created an issue over at the CCK module (#715458: CCK field type that does not store data does not show up in Views) to figure out the best way of handling the issue. The problem really comes down to the fact that a field won't show up in views unless database columns have been defined. In the mean time, I will look into the update failure and find a workaround until my support request has been resolved.
Comment #7
bluestarstudios CreditAttribution: bluestarstudios commentedgreat. thanks
Comment #8
bluestarstudios CreditAttribution: bluestarstudios commentedHave you found any workaround the update problem? Or should I just run update.php and downgrade to the previous version? (I don't know however if that will bring everything back the way it was).
Let me know.
Comment #9
BassistJimmyJam CreditAttribution: BassistJimmyJam commentedSorry, the last few weeks have been really busy and I haven't had much time to spend on this. I am fairly confident that your update actually did succeed, I was just returning the wrong value in the update function. I have fixed this and it won't hurt anything if you were to run it again. I have also included a second update function to create the missing columns.
I still haven't found a way to get a field to appear in the content list for views without it having a database column. What I have done as a workaround is create a tinyint column that can be null. This makes it have a column that takes up the least space possible and still allows it to save nothing to the database.
These changes were included in revision 333830. Please let me know if you have any further issues.
Comment #10
bluestarstudios CreditAttribution: bluestarstudios commentedWorking flawless! Thanks so much for fixing the issue. Hope you have a great weekend and talk to you soon! :)