Skip to content

v0.4.1 — Remove DataRow::duplicate(); document json read leniency

Latest

Choose a tag to compare

@sambhav-aggarwal sambhav-aggarwal released this 20 Jun 16:46

Patch release addressing two items surfaced in post-0.4.0 review.

Breaking removal

DataRow::duplicate() removed

The previous behaviour persisted an orphan row with owner_id = 0 and owner_type = ''. That meant a saved row in data_fields that didn't belong to any real owner — junk-shaped state with no sensible use case.

Replace with one of:

// Clone onto a real owner (recursively re-parents children):
$copy = $row->duplicateInto($newOwner);

// Or, for an unsaved in-memory copy (no DB write, no child copy):
$copy = $row->replicate();

duplicateInto($owner) is unchanged.

Documentation

  • README field-types table now calls out the lenient string-decode behaviour for json, array, and select_multiple reads. If a stored value happens to be a JSON-encoded string (double-encoded or migrated legacy data), the read path decodes it as a recovery measure. Use text for opaque strings — json is for structured data.

No code change in the read path itself; the behaviour was always there.

Full changelog

See CHANGELOG.md.