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

BassistJimmyJam’s picture

This 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.

bluestarstudios’s picture

Status: Active » Fixed

You 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!

bluestarstudios’s picture

Status: Fixed » Needs work

ok. 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!

BassistJimmyJam’s picture

I 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.

bluestarstudios’s picture

So I ran the update, and unfortunately got a Failure:

button_field module
Update #6100

    * Failed: 

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?

BassistJimmyJam’s picture

I 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.

bluestarstudios’s picture

great. thanks

bluestarstudios’s picture

Have 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.

BassistJimmyJam’s picture

Status: Needs work » Fixed

Sorry, 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.

bluestarstudios’s picture

Working flawless! Thanks so much for fixing the issue. Hope you have a great weekend and talk to you soon! :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 157aa68 on 6.x-1.x, 8.x-1.x by BassistJimmyJam:
    #713852 by bluestarstudios: Made sure that the field does not attempt to...
  • Commit fcf7f09 on 6.x-1.x, 8.x-1.x by BassistJimmyJam:
    #713852 by bluestarstudios: Fixed the return value for 6100 update and...