Problem/Motivation
eprecated function: Creation of dynamic property Drupal\block_field\Plugin\Field\FieldFormatter\BlockFieldLabelFormatter::$currentUser is deprecated in Drupal\block_field\Plugin\Field\FieldFormatter\BlockFieldLabelFormatter->__construct() (line 45 of modules/contrib/block_field/src/Plugin/Field/FieldFormatter/BlockFieldLabelFormatter.php).
Drupal\block_field\Plugin\Field\FieldFormatter\BlockFieldLabelFormatter->__construct('block_field_label', Steps to reproduce
Use the block field label formatter for viewing the block and press save
Proposed resolution
Add the property to the class.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | block-field-deprecation-label-formatter-3403040-13.patch | 1.15 KB | handkerchief |
Issue fork block_field-3403040
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
Comment #4
chetan 11 commentedHi
I have fixed the error on my local setup, please check the raised MR for the solution.
Thanks.
Comment #5
yobottehg commentedFix is good but the variable is on the wrong place as it moves the doc block away from the place where it belongs.
Variable could also use some documentation.
Comment #6
chetan 11 commentedHi,
I have updated the code with some fixes, please check the raised MR once.
Comment #7
yobottehg commentedLGTM
Comment #9
rossb89 commentedLooks like this ticket and #3371085: Fix deprecation notices are the same issue, we should close one of them and aim to get one merged in.
Comment #10
anybodyClosing #3371085: Fix deprecation notices as duplicate in favor of this.
Please credit @Grevil for the fix over there.
Could we please get this merged, now that PHP 8.3 is official and PHP 8.1 has no more active support?
https://www.php.net/supported-versions.php
Comment #11
visios commentedPlease merge, thanks @Grevil.
Comment #12
handkerchief+1 please merge, thank you all.
Comment #13
handkerchiefBecause it is not yet merged, a patch may still be needed for many, which is integrated with updates, here it is.
Comment #14
anybody@handkerchief perhaps contact a maintainer to merge this?
Comment #17
berdirMerged.
Comment #19
anybody@Berdir could you maybe tag a new release? The notices still appear and PHP 8.2 is used frequently :)
Comment #20
anybodyPS: I think @Grevil should be credited here based on #3371085: Fix deprecation notices, which I closed in favor of this one.