Repository navigation
v7.0.75
Map agent brands: hardened matching + debug output
Investigating why only one agent received a brand_id when several should.
Matching hardening (logic unchanged)
- Normalize both sides before comparing: trim whitespace and wrapping quotes from each agent's
api_idmeta and fromusers[0].id. Removes hidden-formatting mismatches (common with CSV-imported api_ids). reset($users)instead of$users[0]— grabs the single user even if the API returns a non-zero-indexed / object-shapedusersarray.- Agent query now includes all non-trashed statuses (
publish, draft, pending, private, future), not publish-only.
Debug payload
The rch_map_agent_brands AJAX response now includes:
debug.mapping_keys – single-user child user ids found
debug.agent_api_ids – every agent's api_id read from meta
debug.unmatched_ids – user ids that found no matching agent
Compare mapping_keys vs agent_api_ids to see whether the loss is on the API side (few single-user children) or the id comparison.
Version bumped 7.0.74 → 7.0.75.