Problem/Motivation

Follow-up to #3622400. The contrib Content Lock consult calls fetchLock($entity). That is the 3.x API. Content Lock 8.x-2.x (still installable on Drupal 10, which this module supports) has:

fetchLock($entity_id, $langcode, $form_op = NULL, $entity_type = 'node')

$langcode is required. method_exists(..., 'fetchLock') is true on both majors, so the first governed JSON:API PATCH / tool save / delete on a D10 + Content Lock 2.x site throws ArgumentCountError — including when nothing is locked. That is a 500 on the agent channel, not a 422, and it never writes a content_lock_conflict evidence row.

W&L production uses Content Lock 3.x and is not affected. The optional consult must not take down the write plane on the rest of the support matrix.

Steps to reproduce

  1. Drupal 10.6, mcp_sentinel 1.x after #3622400, contrib content_lock 8.x-2.x enabled.
  2. Governed JSON:API PATCH of any existing node (locked or not).

Expected: 2xx or a 422 lock conflict. Actual: 500 ArgumentCountError from McpContentLock::fetchEditorialLock().

Proposed resolution

Dispatch on the number of required parameters (3.x = 1, 2.x = 2). Call the matching signature. Catch \TypeError (ArgumentCountError extends it) and skip the editorial consult rather than taking down the write plane.

Remaining tasks

  • Signature-safe fetchLock.
  • Unit double whose fetchLock requires ($id, $langcode, ...).

User interface changes

None.

API changes

None.

Data model changes

None.

Comments

jmcerda created an issue. See original summary.

jmcerda’s picture

Status: Active » Fixed

Committed to 1.x. The contrib consult now dispatches on the number of required fetchLock parameters (3.x vs 8.x-2.x) and treats a TypeError as no editorial lock rather than taking down the write plane.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • jmcerda committed 4d56c9f7 on 1.x
    Issue #3622402: Do not 500 governed writes on Content Lock 2.x.
    
    The #...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.