Problem/Motivation

Modernize the code and support Drupal 9.5 and 10.0.

This issue takes https://www.drupal.org/project/views_linkarea/issues/3290506 and makes next steps more clear.

Proposed Resolution

* Create 2.0.x (semantic versioning) branch
* Set default testing for 2.0.x branch
* Ensure tests pass for Drupal 9.5 and 10.1 for the 2.0.x branch -- these currently fail
* Create 2.0.0 release
* Set 2.0.x as default branch

I would not release 8.x-1.5 because we should not support Drupal 8.9.

Comments

agentrickard created an issue. See original summary.

agentrickard’s picture

agentrickard’s picture

Status: Active » Needs review
StatusFileSize
new554 bytes

PHP Stan also has errors to report:

 ------ ------------------------------------------------------------------------------------------ 
  Line   src/Plugin/views/area/Link.php                                                            
 ------ ------------------------------------------------------------------------------------------ 
  75     Parameter #3 $plugin_id (string) of method                                                
         Drupal\views_linkarea\Plugin\views\area\Link::create() should be contravariant with       
         parameter $plugin_id (mixed) of method                                                    
         Drupal\views\Plugin\views\ViewsPluginInterface::create()                                  
  75     Parameter #3 $plugin_id (string) of method                                                
         Drupal\views_linkarea\Plugin\views\area\Link::create() should be contravariant with       
         parameter $plugin_id (mixed) of method                                                    
         Drupal\views\Plugin\views\ViewsPluginInterface::create()                                  
  117    Method Drupal\views_linkarea\Plugin\views\area\Link::buildOptionsForm() has no return     
         type specified.                                                                           
  117    Method Drupal\views_linkarea\Plugin\views\area\Link::buildOptionsForm() has parameter     
         $form with no type specified.                                                             
  252    Method Drupal\views_linkarea\Plugin\views\area\Link::validateOptionsForm() has no return  
         type specified.                                                                           
  252    Method Drupal\views_linkarea\Plugin\views\area\Link::validateOptionsForm() has parameter  
         $form with no type specified.                                                             
  268    Construct empty() is not allowed. Use more strict comparison.                             
  273    Construct empty() is not allowed. Use more strict comparison.                             
  305    Construct empty() is not allowed. Use more strict comparison.                             
  314    Only booleans are allowed in a negated boolean, string|false|null given.                  
  320    Only booleans are allowed in a negated boolean, string|false|null given.                  
  331    Construct empty() is not allowed. Use more strict comparison.                             
  335    Construct empty() is not allowed. Use more strict comparison.                             
  335    Variable $url_info in empty() is never defined.                                           
  343    Construct empty() is not allowed. Use more strict comparison.                             
  349    Construct empty() is not allowed. Use more strict comparison.                             
  349    Construct empty() is not allowed. Use more strict comparison.                             
  349    Construct empty() is not allowed. Use more strict comparison.                             
  386    Only booleans are allowed in &&, string given on the left side.                           
  391    Only booleans are allowed in an if condition, string given.                               
  395    Construct empty() is not allowed. Use more strict comparison.                             
  395    Only booleans are allowed in &&, string given on the right side.                          
  400    Construct empty() is not allowed. Use more strict comparison.                             
  404    Construct empty() is not allowed. Use more strict comparison.                             
 ------ ------------------------------------------------------------------------------------------ 

Here's a simple patch to trigger the testbot for this issue.

anybody’s picture

Title: Drupal 10 compatible release » Drupal 10 compatible release, test and code style fixes
Status: Needs review » Needs work

We'll have a look here, thanks @agentrickard. Can we use a MR for that, based on your patch? I think that would make things easier.

I'll ask my teammate @Grevil to help, as I'm very busy this week.

anybody’s picture

Could this be the reason for the failing tests?
#3056234: User context missing when using toUrl in some circumstances

I was searching for the error message.

agentrickard’s picture

Regarding releases: In general, I have been keeping an 8.x release if we feel that people are still running Drupal 8 (which they shouldn't), so we could remove Drupal 10 support from 8.x-1.x, tag a stable 8.x-1.6 for Drupal 8 || 9, and then release 2.0.0.

We would mark 2.0.0 as the "supported" version. See https://www.drupal.org/project/workbench_access for an example of this pattern.

First, I'd like to get this test to pass. The phpstan issues can be addressed later.

agentrickard’s picture

MR is fine -- I still use a patch workflow on d.o., but if you prefer MR, go for it.

And yes, that looks like the test error.

agentrickard’s picture

Status: Needs work » Needs review
StatusFileSize
new1.33 KB

Indeed, that issue had the answer. Apparently Kernel tests don't create any users, and the anon user is required for the access context.

agentrickard’s picture

StatusFileSize
new6.24 KB

This should be fine for a release. I marked a number of items as @phpstan-ignore-next-line related to strick checking of the empty() check. I am not sure what syntax is better in those cases.

I think those can be cleaned up in a follow-up issue.

agentrickard’s picture

Status: Needs review » Fixed

This has been committed.

anybody’s picture

Indeed, that issue had the answer. Apparently Kernel tests don't create any users, and the anon user is required for the access context.

Nice!!

I think those can be cleaned up in a follow-up issue.

Yes indeed! Once @Grevil has a bit more spare time than me, he'll surely also have a look at the tests and code style issues. Feel free to add him as Co-Maintainer.

agentrickard’s picture

@Anybody -- I went ahead and updated the releases, added @Grevill and boosted your maintainer privileges, too.

I also set 2.0.x to be the default branch and set default testing to Drupal 10.1 and 9.5

grevil’s picture

Thank you, @agentrickard!

I see you already fixed the tests! I am not too seasoned with Kernel Tests, but they LGTM! We can surely add a few more tests in the future, but for now I think they are fine!

grevil’s picture

I created a follow-up issue for the remaining problems here: #3334757: Code style and phpstan fixes..

agentrickard’s picture

Cool. I'm going to back away from this module now.

Status: Fixed » Closed (fixed)

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