Repository navigation
Conversation
bd3db76 to
33746b5
Compare
| public function delete(int $entityTypeId): DeletedItemResult | ||
| { | ||
| return new DeletedItemResult($this->core->call('crm.type.delete', ['entityTypeId' => $entityTypeId])); | ||
| return new DeletedItemResult($this->core->call('crm.type.delete', ['id' => $entityTypeId])); |
There was a problem hiding this comment.
Please update the existing callers before merging this change. Four cleanup calls in ItemTest.php (lines 92, 114, 159 and 179) pass $addedTypeItemResult->type()->entityTypeId. This line sends that value as the internal type id. When the two IDs differ, the operation targets the wrong record. If that ID belongs to another empty type the account can delete, cleanup can remove it while leaving its own fixture behind.
Please delete the fixture's items first, pass $addedTypeItemResult->getId() to delete(), and document which ID callers must supply, including for named arguments. Add regression coverage with distinct IDs that verifies the fixture type is gone and the other type remains. The new check for a null REST result is worth keeping.
Smart-process exports currently need direct core calls or access to protected batch internals to discover universal CRM categories and read original custom-field names. This PR exposes typed read APIs through the existing CRM builder and preserves the request shape of existing calls.
category()->fields/get/listwith typed category results and paged list access.useOriginalUfNames=falseto itemfields/get/list/countByFilterand batchlist; true sendsuseOriginalUfNames=Y.idfrom explicit selects in that mode, preventing safe traversal. Invalid combinations fail before requesting data. Existing default-mode batch calls remain unchanged.type()->delete()to send the documented internalid, preserving the legacy PHP argument name for named callers. Its result now reads the response, rejects null/no-op, and surfaces API errors.Validation: CS fixer, Rector, PHPStan and Deptrac passed. Full unit suite: 2467 tests / 13259 assertions, with the same 11 pre-existing deprecations as baseline. Targeted live integration: 5 tests / 153 assertions, including original-name filters, 55 unique records across batch pages, limited traversal, category metadata/result annotations, real type deletion and cleanup. Temporary fixture items are deleted before their type; absence of the type is verified. Existing Rector configuration deprecation warnings remain.
No new runtime dependencies.
Closes #727
Closes #728