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

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

will_frank created an issue. See original summary.

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

yusuf_khan’s picture

Assigned: Unassigned » yusuf_khan

Working on it

yusuf_khan’s picture

Category: Bug report » Task
Status: Active » Needs review

@will_frank can you please review my MR

will_frank’s picture

Category: Task » Bug report
Status: Needs review » Active

@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-...

will_frank’s picture

on 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

will_frank’s picture

@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.

yusuf_khan’s picture

https://git.drupalcode.org/project/views_sort_null_field/-/merge_request... -@ will_frank comment 7 issue has been address please review

generalredneck’s picture

Status: Active » Needs review

@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.

generalredneck’s picture

Status: Needs review » Needs work

The 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.

generalredneck’s picture

Status: Needs work » Needs review
StatusFileSize
new31.74 KB

Feel 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.

screenshot

joachim’s picture

Does the views_entity_field_label() change belong in this issue?

generalredneck’s picture

Joachim,

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.

generalredneck’s picture

Version: 8.x-1.3 » 8.x-1.x-dev
Status: Needs review » Fixed

I've taken the liberty of merging this as I have this fix running on my own sites and I'm pulling co-maintainer rank.

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.

generalredneck’s picture

Assigned: yusuf_khan » Unassigned

Status: Fixed » Closed (fixed)

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