Using the "owner" public property of a TempStore lock is deprecated in Drupal 8.7.0 and will not be allowed in Drupal 9.0.0. Use \Drupal\Core\TempStore\Lock::getOwnerId() instead

Change record: https://www.drupal.org/node/3025869
Original issue #3025867: Provide a classed object for TempStore metadata

This was deprecated in core 8.7.0, but Drupal 8.6.x will be supported until Drupal 8.8.0 is released, which is scheduled for December 4, 2019

We can't commit this change until Drupal 8.6.x becomes unsupported.

CommentFileSizeAuthor
#3 3092093-3-lock-owner.patch1.59 KBtr
lock-owner.patch1.04 KBtr

Comments

TR created an issue. See original summary.

tr’s picture

Issue summary: View changes
tr’s picture

StatusFileSize
new1.59 KB

Ah, the change record was seriously messed up and wrong. I foolishly believed what it said and made the changes it said to make, and that's why the tests failed.

I had to read the original issue that made the change then extensively correct the change record so someone else might be spared that agony.

Here's a new patch which should be correct this time.

Note that core seems to now have replicated what we already have in rules/src/Form/BreakLockForm.php and rules/src/Ui/TempStoreTrait.php, and we ought to look into using the core versions now that they're available.

jonathan1055’s picture

Adding as child of meta issue

jonathan1055’s picture

Issue summary: View changes
6x: Using the "updated" public property of a TempStore lock is deprecated in Drupal 8.7.0 and will not be allowed in Drupal 9.0.0. Use \Drupal\Core\TempStore\Lock::getUpdated() instead. See https://www.drupal.org/node/3025869.

[edit]Would it make sense to address this other TempStore lock deprecation in this same issue? It is the same test which has both.

Just tested the patch in my Travis builds and it does fix both deprecations.

Also, I know you know this, but for the record, just to confirm the result of the patched code when running at core 8.6 gives:

/admin/config/workflow/rules/reactions/edit/test_rule - Call to undefined method stdClass::getOwnerId()
in /rules/src/Ui/TempStoreTrait.php on line 277
tr’s picture

Would it make sense to address the other TempStore lock deprecation in this same issue?

I don't understand - the patch does address both. Did I miss a line of code somewhere?

jonathan1055’s picture

I had just editted my comment at the very second you posted this. Yes the patch does fix both. Sorry for the noise, I should have checked that first.

  • TR committed 190cbf2 on 8.x-3.x
    Issue #3092093 by TR: Using the "owner" public property of a TempStore...
tr’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

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