Problem/Motivation

drupal-check results on commit hash: aea97e837ea9b1b5522f710239cf7d1cc16f2306


 

 ------ -------------------------------------------------------- 
  Line   tests/src/Functional/ViewUnpublishedViewsTest.php       
 ------ -------------------------------------------------------- 
  15     Usage of deprecated trait                               
         Drupal\simpletest\ContentTypeCreationTrait in class     
         Drupal\Testsiew_unpublished\Functional\ViewUnpublish  
         edViewsTest.                                            
 ------ -------------------------------------------------------- 

 [ERROR] Found 1 error                                          
 

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

mcdwayne created an issue. See original summary.

Cary_Dean’s picture

Assigned: Unassigned » Cary_Dean
Status: Active » Needs review
StatusFileSize
new512 bytes

Simple enough fix. Here ya go

Cary_Dean’s picture

StatusFileSize
new515 bytes

I am not sure why that failed to apply. I can pull down the dev branch and apply it without issues.

john cook’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +ContributionWeekend2020

The patch looks good and applies cleanly.

Results after patch.

./vendor/bin/drupal-check modules/contrib/view_unpublished/
 7/7 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

                                                                                             
 [OK] No errors                                                                              
                                                                                             

Marking as RTBC.

jenlampton’s picture

I believe that if you add drupal 9 as an option to the composer.json file in this project you can get a nice little Compatible with Drupal 9 badge in the Project information section on the module page.

Screenshot of the Project information section with Compatible with Drupal 9 highlighted

Below is a code sample from a module that has the badge.

"require": {
        "php": "^7.1",
       "drupal/core": "^8 || ^9"
  },

It also looks like it may possible to get the badge by adding the 'core_version_requirement' key in the module's info.yml file, which, in turn, will add the version to the require section of composer.json. Example follows.

core_version_requirement: ^8 || ^9

Do you want to include this change in the patch here or open a separate issue?

jeroent’s picture

StatusFileSize
new88.44 KB

@jenlampton,

I think this is a field that the maintainer of this module can fill in when editing the project. See https://www.drupal.org/project/slick/issues/3069793

Drupal 9 compatibility

xem8vfdh’s picture

I don't know about @JeroenT's suggestion, maybe that works, but I've seen lots of other projects doing what @jenlampton mentioned. Can the patch be updated to reflect that?

Apparently there is some maintainer text field that allows the maintainer to mark the module as D9 compatible to show the badge on the module's main page. I'm not a maintainer so I don't know where that switch is, unfortunately. But core maintainers have assured me that composer.yml and info.yml do not come into play.

gaëlg’s picture

Upgrade status module told me:

Add core_version_requirement: ^8 || ^9 to view_unpublished.info.yml to designate that the module is compatible with Drupal 9. See https://drupal.org/node/3070687.

It doesn't impact the d.o. "D9 badge" (which is indeed a text field on the d.o. project node edit form), but it looks like it's needed though.

tresti88’s picture

Updated the patch provided in comment #3 to the correct use statement for the `ContentTypeCreationTrait` class as this fits with Drupal's Coding standards.

Didn't include `core_version_requirement` as patch won't apply because of `Information added by Drupal.org packaging script on 2017-01-04` in the info.yml file. I guess this is for the module maintainer to add.

Cheers

tresti88’s picture

StatusFileSize
new525 bytes

Actually attach the correct patch.....

tresti88’s picture

Status: Reviewed & tested by the community » Needs review
xem8vfdh’s picture

StatusFileSize
new911 bytes

@tresti88, your patch applied and resolve the deprecation warning. I don't follow your comment regarding core_version_requirement, and that should be included in the patch. So I created a new patch that includes that change. If it didn't apply for you, you might have been doing something wrong. 3042754-11.patch applies just fine for me on as fresh clone of the 8.x-1.x branch.

xem8vfdh’s picture

Status: Needs review » Reviewed & tested by the community
tresti88’s picture

I should have mentioned that i was using composer to apply the patch to an existing project. I was conscious that this project hasn't had any dev commits since 2017. I didn't want to submit a patch that would fail to apply for those who just wanted to solve errors in the deprecated report. The core_version_requirement just threw up a warning. If you think it's best to add the core_version_requirement then i can update the patch to include the following in the info.yml file: core_version_requirement: ^8.4 || ^9

xem8vfdh’s picture

You don't need to update the patch, I've already done it because, yes, core_version_requirement should be included :)

The patch should be apply-able to dev so that the mods can merge it in cleanly. If it's conflicting with your project, then you must have applied other patches previously that this patch conflicts with. Patching prod repeatedly is not a good long term approach, for this reason (and others).

tresti88’s picture

ahh gotya! Cheers :)

xem8vfdh’s picture

maintainers, should this be merged?

xem8vfdh’s picture

Assigned: Cary_Dean » Unassigned

Can a maintainer please merge this?

klemendev’s picture

I agree that would be helpful :)

amaria’s picture

Be aware that this module's functionality will be available in Drupal 9... Per-bundle unpublished content permissions. That will essentially deprecate this module for Drupal 9.

xem8vfdh’s picture

oh, I didn't know that @amaria, thanks for the info!

jeroent’s picture

@amaria,

The change record you mention is still draft. The issue is still not resolved and that functionality won't be included before Drupal 9.1. So IMO this module is currently still valuable. Once that issue lands in core, we can provide an upgrade path to those permissions and deprecate this module.

xem8vfdh’s picture

i agree @JeroenT

xem8vfdh’s picture

this is a possible avenue to pursue: https://www.drupal.org/blog/the-maintainers-intiative

amaria’s picture

Fair enough, @JeroenT. Will merge after a quick review

xem8vfdh’s picture

any update @amaria?

amaria’s picture

Please re-roll against the latest dev. The patch did not apply.

xem8vfdh’s picture

StatusFileSize
new918 bytes

re-rolling, see 3042754-12.patch

$ ./vendor/bin/drupal-check modules/view_unpublished/
 7/7 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
                                                                                                          
 [OK] No errors
xem8vfdh’s picture

  • amaria committed f870b01 on 8.x-1.x
    Issue #3042754 by xeM8VfDh, tresti88, Cary_Dean, JeroenT: Drupal 9...
xem8vfdh’s picture

StatusFileSize
new6.19 KB

@amaria, thanks for commiting, should this issue be marked as fixed now? Also, can you flip the setting on this Drupal.org module page to enable the Drupal 9 support badge (example, d9support.png).

amaria’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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