Allow deserializing readonly properties

Created on 10 October 2021, almost 3 years ago
Updated 29 July 2022, about 2 years ago

Problem/Motivation

Working on #3233375: Stop supporting Xml in queries I discovered an unrelated bug...

In #3102407: Support partial updates to Xero items we introduced the notion that Xero items could have "specified properties" which indicated a non-default value that had been set on an item and should be pushed to Xero. Part of that process is that read-only properties are dropped from the values output when XeroItemBase::getValue() is called.

Unfortunately, we forgot to allow for deserialization. Deserialization involves calling getValue on an item in order to add it to the list: $items->offsetSet(NULL, $item->getValue());.

The code as it currently is makes it impossible to deserialize a read-only property provided by Xero.

Steps to reproduce

Try deserializing a user response (all user properties are read-only).

Proposed resolution

Use not pristine state to do custom getValue for specified properties.

Remaining tasks

User interface changes

None.

API changes

Denormalized items and lists are always pristine.

Data model changes

None.

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom jonathanshaw Stroud, UK

Live updates comments and jobs are added and updated live.
  • Needs manual testing

    The change/bugfix cannot be fully demonstrated by automated testing, and thus requires manual testing in a variety of environments.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024