Problem/Motivation
there are a number of deprecated code issues relative to php version 8.4
Steps to reproduce
I ran php -l on this module with php 8.4 and got these deprecation issues:
Deprecated: Case statements followed by a semicolon (;) are deprecated, use a colon (:) instead in ./contrib/views_sort_null_field/src/Plugin/views/sort/NullSort.php on line 54
Deprecated: Case statements followed by a semicolon (;) are deprecated, use a colon (:) instead in ./contrib/views_sort_null_field/src/Plugin/views/sort/NullSort.php on line 55
Proposed resolution
each error indicates how to fix it
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #3
yusuf_khan commentedWorking on it
Comment #5
yusuf_khan commented@will_frank can you please review my MR
Comment #6
will_frank commented@yusuf_khan it's great that you're working on all these issues that I filed. If you're able
could you take a look at layout_paragraphs? If so, see:
https://www.drupal.org/project/layout_paragraphs/issues/3514212#comment-...
Comment #7
will_frank commentedon your merge request I saw this which looks like a still unresolved error:
Major - Call to deprecated function views_entity_field_label(): in drupal:11.2.0 and is removed from drupal:12.0.0. Use \Drupal::service('entity_field.manager')->getFieldLabels() instead.
in views_sort_null_field.views.inc:22
Comment #8
will_frank commented@yusuf_kkan - I was able to apply the diffs from your merge merge request !6 and run php -l against
the resulting code successfully with no remaining syntax errors. So I approve.
Comment #9
yusuf_khan commentedhttps://git.drupalcode.org/project/views_sort_null_field/-/merge_request... -@ will_frank comment 7 issue has been address please review
Comment #10
generalredneck@will_frank,
For future reference, lets move the Drupal 12 deprecations to another issue or change this one to say. They are not tied to PHP 8.4. I get that PHPstan said this was an issue, but yeah there's a lot more Drupal 12 issues we are going to have to worry about.
Also when a thing needs more work, change the status to "needs work" not "active" please.
@yusuf_kahan,
If you need review, lets change the status to such.
Comment #11
generalredneckThe latest changes causes phpunit tests to fail it seems. I've set up a monthly cron so that GitlabCI will run on this project and we can be notified of these types of issues sooner.
I'm going to take a look at this because PHPCS catches all the php 8.4 deprecations.
Comment #12
generalredneckFeel free to review. Since we support drupal/core ^8||^9||^10||^11, we have to add the DeprecationHelper in the mix.
I've not actually tested to see how this affects drupal 8 or 9, but I have tested in Drupal 10.
Comment #13
joachim commentedDoes the views_entity_field_label() change belong in this issue?
Comment #14
generalredneckJoachim,
PHPStan was complaining about it so will_frank asked for the change.
With the change we get a clean run of CI
See https://git.drupalcode.org/project/views_sort_null_field/-/merge_request... for the history.
Comment #15
generalredneckI've taken the liberty of merging this as I have this fix running on my own sites and I'm pulling co-maintainer rank.
Comment #17
generalredneck