Problem/Motivation

date_update_7007 loops over all datestamp fields and unconditionally calls db_change_field on some tables. On sites using the core provided Field SQL Storage backend, this is fine and will work fine. If you have configured a different field storage backend and are using it for datestamp fields, then the update hook will fail.

Steps to reproduce

Use a different field storage backend that doesn't create the same tables as the core field_sql_storage backend, have a datestamp field, and run the update hook.

Proposed resolution

You can't cater for all the field storage backends out there, which is why the API for doing these field schema changes never made it into D7 core properly. So instead, we should cater for the 99.9% of people using field_sql_storage, but not break for the other 0.1%.

Add a db_table_exists call around the existing code.

Remaining tasks

Code the patch.

Comments

Steven Jones created an issue. See original summary.

joseph.olstad’s picture

Status: Active » Needs review
Parent issue: » #2867810: Plan for Date 7.x-2.11 release
joseph.olstad’s picture

Status: Needs review » Needs work

ah, no patch to review

steven jones’s picture

Status: Needs work » Needs review
StatusFileSize
new794 bytes
steven jones’s picture

Status: Needs review » Needs work

Oh, and actually as pointed out in #2016787-15: Far dates causes PDOException 22003 this will fail when there are other columns too.

steven jones’s picture

Status: Needs work » Needs review
StatusFileSize
new1.04 KB

So this updated patch targets just the value and value2 columns, which are the only ones that need changing anyway.

joseph.olstad’s picture

Status: Needs review » Reviewed & tested by the community

The added checks are an improvement, well done.

damienmckenna’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thank you Steven!

joseph.olstad’s picture

w00t! thanks DamienMcKenna!

Status: Fixed » Closed (fixed)

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