Skip to content

fix(Address): make address_2 writable in setMainFields() - #10

Open
Pichinov-Jose wants to merge 1 commit into
SplashSync:masterfrom
Pichinov-Jose:fix/address-2-writable
Open

fix(Address): make address_2 writable in setMainFields()#10
Pichinov-Jose wants to merge 1 commit into
SplashSync:masterfrom
Pichinov-Jose:fix/address-2-writable

Conversation

@Pichinov-Jose

Copy link
Copy Markdown

Problem

On the Address object, the second address line (address_2) is declared in buildMainFields() and readable in getMainFields(), but it is missing from the setMainFields() write switch.

Any inbound write that includes address_2 therefore falls through to default: return; and the field is never consumed (unset($this->in[...]) is not reached). IntelParserTrait then raises ErrLocalWrongField:

Splash\Local\Objects\Address::setObjectData() => Error : Field "address_2" do not Exists.

and the entire address write is rejected (Last Change not exported). setMainFields() is the only setter for the Address object, so no other trait recovers the field. This affects billing-type addresses (logistic types intentionally skip writing).

Fix

Add the missing case 'address_2': alongside case 'address_1': in setMainFields(), so the second address line is persisted via setUserMeta() like the other postal fields.

Notes

  • The field's microData (schema.org/PostalAddress / postOfficeBoxNumber) is unchanged — only the write path was missing.
  • Present on master and every 2.0.x tag (reproduced with v2.0.10 syncing customer addresses from another Splash connector).

🤖 Generated with Claude Code

The `address_2` field is declared in buildMainFields() and readable in
getMainFields(), but was missing from the setMainFields() write switch.
Any inbound write containing `address_2` fell through to `default: return;`
without being consumed, so IntelParserTrait raised ErrLocalWrongField
("Field \"address_2\" do not Exists") and the entire address write failed.

Add the missing `case 'address_2':` alongside `address_1` so the second
address line is persisted like the other postal fields.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant