Currently, on Open Atrium 2.25, attempting to use the "Preview" button when creating a new node causes a fatal error:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'content_id' cannot be null: INSERT INTO {flag_content} (fid, content_type, content_id, uid, sid, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( [:db_insert_placeholder_0] => 3 [:db_insert_placeholder_1] => node [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => 1 [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => 1417014685 ) in flag_flag->_flag() (line 801 of /var/aegir/prj/bucketb_atrium/modules/contrib/flag/flag.inc).

This seems like a bug in the Flag module.

However! The "Preview" button doesn't really show a preview anyway - it renders the node without using the Panelizer defaults, only the default display settings. To get a real preview of what the node will look like, the "Save as draft" button works better!

So, should we remove the "Preview" button from all node types, and instead encourage use of the "Save as draft" button?

If there is agreement on this, I can create some patches...

Comments

Argus’s picture

The preview option is a Drupal submission form setting on the content types' edit page. I would agree setting it to Disabled by default. But if someone would change the setting to Optional or Required the bug you found would still be there. So perhaps better separate this Feature Request and the Bug report?

mpotter’s picture

Category: Task » Feature request
hefox’s picture

I agree that should disable preview for now -- @mpotter?

mpotter’s picture

Yep, I agree.

hefox’s picture

Status: Active » Fixed
Related issues: +#2400131: Disable preview by default

Done for all core oa types, opened issue in worktracker to do it there.

Status: Fixed » Closed (fixed)

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