At /admin/content, when running the "Break lock node" operation, the query that is ran uses a language object, causing the following error:
Object of class Drupal\Core\Language\Language could not be converted to string in Drupal\Core\Database\Statement->execute() (line 59 of core/lib/Drupal/Core/Database/Statement.php).

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Keith Caulkins created an issue. See original summary.

Keith Caulkins’s picture

StatusFileSize
new573 bytes

Nevermind, do not use this patch

Keith Caulkins’s picture

StatusFileSize
new576 bytes

This patch should do the trick on 8.x-1.x-dev

Keith Caulkins’s picture

Version: 8.x-1.0-alpha8 » 8.x-1.x-dev
Keith Caulkins’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 3: languageString-3071692-2.patch, failed testing. View results

Punk_UnDeaD’s picture

i think we need fix

  public function execute(ContentEntityInterface $entity = NULL) {
    $this->lockService->release($entity->id(), $entity->language(), NULL, NULL, $entity->getEntityTypeId());
  }

because all other inner function used langcode

Punk_UnDeaD’s picture

StatusFileSize
new621 bytes
spadxiii’s picture

Status: Needs work » Reviewed & tested by the community

Last patch seems to do the trick, in the correct location.

chr.fritsch’s picture

Status: Reviewed & tested by the community » Needs work

Since tests are failing, this can not be considered as done.

smustgrave’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev
Status: Needs work » Postponed (maintainer needs more info)

The change makes sense, but I'm not able to replicate the error. Are there additional steps needed?

astonvictor made their first commit to this issue’s fork.

astonvictor’s picture

thanks for the report.

I was able to reproduce it:
1. Enable content_lock 8.x-2.x, conflict 3.0.0.
2. Enable the 'Lock only on entity translation level.' config for nodes on the /admin/config/content/content_lock page.
3. Execute the 'Break lock node' action on the /admin/content page.

as a result, I had Error: Object of class Drupal\Core\Language\Language could not be converted to string in PDOStatement->execute() error.

astonvictor’s picture

Status: Postponed (maintainer needs more info) » Fixed

Status: Fixed » Closed (fixed)

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