Problem/Motivation

Drupal 10.0.0 stable was released on: 15 Dec 2022 by the Drupal core team
https://www.drupal.org/project/drupal/releases/10.0.0


Thank you so much!

The current composer require status for this module under Drupal 10

composer create-project drupal/recommended-project:~10 /var/www/html/sandboxes/drupal10anchor_link
cd  /var/www/html/sandboxes/drupal10anchor_link/
composer require drupal/anchor_link;

is having the following problem

Using version ^2.5 for drupal/anchor_link
./composer.json has been updated
Running composer update drupal/anchor_link
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - drupal/anchor_link 2.x-dev is an alias of drupal/anchor_link dev-2.x and thus requires it to be installed too.
    - drupal/anchor_link[dev-2.x, 2.5.0] require drupal/fakeobjects ^1.0 -> satisfiable by drupal/fakeobjects[1.0.0, 1.1.0, 1.x-dev].
    - drupal/fakeobjects 1.0.0 requires drupal/core ^8 -> found drupal/core[8.0.0-beta6, ..., 8.9.x-dev] but the package is fixed to 10.0.0-alpha4 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - drupal/fakeobjects[1.1.0, ..., 1.x-dev] require drupal/core ^8 || ^9 -> found drupal/core[8.0.0-beta6, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev] but the package is fixed to 10.0.0-alpha4 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - Root composer.json requires drupal/anchor_link ^2.5 -> satisfiable by drupal/anchor_link[2.5.0, 2.x-dev (alias of dev-2.x)].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require drupal/anchor_link:*" to figure out if any version is installable, or "composer require drupal/anchor_link:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Further drupal-check on

composer create-project drupal/recommended-project:~9 /var/www/html/sandboxes/drupal9anchor_link

cd /var/www/html/sandboxes/drupal9anchor_link/

composer config minimum-stability dev

composer require drupal/anchor_link:1.x-dev

composer require drupal/core-dev:~9 --with-all-dependencies
composer require mglaman/drupal-check --dev
composer require phpspec/prophecy-phpunit:^2 --dev 

php vendor/bin/drupal-check -d web/modules/contrib/anchor_link/

Output:

4/4 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ -------------------------------------------------------------------- 
  Line   src/Plugin/CKEditorPlugin/AnchorLink.php                            
 ------ -------------------------------------------------------------------- 
  23     Call to deprecated function drupal_get_path():                      
         in drupal:9.3.0 and is removed from drupal:10.0.0. Use              
           \Drupal\Core\Extension\ExtensionPathResolver::getPath() instead.  
  56     Call to deprecated function drupal_get_path():                      
         in drupal:9.3.0 and is removed from drupal:10.0.0. Use              
           \Drupal\Core\Extension\ExtensionPathResolver::getPath() instead.  
  60     Call to deprecated function drupal_get_path():                      
         in drupal:9.3.0 and is removed from drupal:10.0.0. Use              
           \Drupal\Core\Extension\ExtensionPathResolver::getPath() instead.  
  64     Call to deprecated function drupal_get_path():                      
         in drupal:9.3.0 and is removed from drupal:10.0.0. Use              
           \Drupal\Core\Extension\ExtensionPathResolver::getPath() instead.  
 ------ -------------------------------------------------------------------- 

 ------ -------------------------------------------------------------------- 
  Line   src/Plugin/CKEditorPlugin/FakeObjects.php                           
 ------ -------------------------------------------------------------------- 
  24     Call to deprecated function drupal_get_path():                      
         in drupal:9.3.0 and is removed from drupal:10.0.0. Use              
           \Drupal\Core\Extension\ExtensionPathResolver::getPath() instead.  
 ------ -------------------------------------------------------------------- 

 ------ ----------------------------------------------------------------------- 
  Line   src/Plugin/Linkit/Matcher/CKEditorAnchorLinkMatcher.php                
 ------ ----------------------------------------------------------------------- 
  18     Class                                                                  
         Drupal\anchor_link\Plugin\Linkit\Matcher\CKEditorAnchorLinkMatcher     
         extends unknown class Drupal\linkit\MatcherBase.                       
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols    
  24     Instantiated class Drupal\linkit\Suggestion\SuggestionCollection not   
         found.                                                                 
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols    
  28     Instantiated class Drupal\linkit\Suggestion\DescriptionSuggestion not  
         found.                                                                 
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols    
  29     Call to an undefined method                                            
         Drupal\anchor_link\Plugin\Linkit\Matcher\CKEditorAnchorLinkMatcher::t  
         ().                                                                    
  29     Call to method setLabel() on an unknown class                          
         Drupal\linkit\Suggestion\DescriptionSuggestion.                        
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols    
  31     Call to an undefined method                                            
         Drupal\anchor_link\Plugin\Linkit\Matcher\CKEditorAnchorLinkMatcher::t  
         ().                                                                    
  33     Call to method addSuggestion() on an unknown class                     
         Drupal\linkit\Suggestion\SuggestionCollection.                         
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols    
 ------ ----------------------------------------------------------------------- 

 [ERROR] Found 12 errors                                                        

Thanks for using drupal-check!

Consider sponsoring the development of the maintainers which make drupal-check possible:

- phpstan (ondrejmirtes): https://github.com/sponsors/ondrejmirtes
- phpstan-deprecation-rules (ondrejmirtes)): https://github.com/sponsors/ondrejmirtes
- phpstan-drupal (mglaman)): https://github.com/sponsors/mglaman
- drupal-check (mglaman)): https://github.com/sponsors/mglaman


Proposed resolution

  • Support Drupal ~10 and change all deprecated packages, classes, functions, asset libraries to the Drupal 10 way
  • Real physical testing with Drupal ~10
  • Automated upgrade to Drupal ~10

Remaining tasks

  • ✅ File an issue
  • ✅ Addition/Change/Update/Fix
  • ✅ Testing to ensure no regression
  • ➖ Automated unit testing coverage
  • ➖ Automated functional testing coverage
  • ➖ UX/UI designer responsibilities
  • ➖ Readability
  • ➖ Accessibility
  • ➖ Performance
  • ➖ Security
  • ➖ Documentation
  • ✅ Code review by maintainers
  • ✅ Full testing and approval
  • ✅ Credit contributors
  • ✅ Review with the product owner
  • ✅ Release notes snippet
  • ✅ Release anchor_link-1.10.0 , anchor_link-2.6.0

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • Issue #3277445 by Rajab Natshah: Support Drupal 10 and update all use of deprecation in the CKEditor Anchor Link module

Comments

Rajab Natshah created an issue. See original summary.

rajab natshah’s picture

Project: Entity Browser Enhance(d|r) » CKEditor Anchor Link

  • Rajab Natshah committed 0a016a0 on 8.x-1.x
    Issue #3277445: Support Drupal 10 and update all use of deprecations in...

  • Rajab Natshah committed e533eba on 8.x-2.x
    Issue #3277445: Support Drupal 10 and update all use of deprecations in...

  • Rajab Natshah committed 6938068 on 3.0.x
    Issue #3277445: Support Drupal 10 and update all use of deprecations in...
rajab natshah’s picture

Status: Active » Needs review
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Version: 8.x-1.x-dev » 3.0.x-dev
rajab natshah’s picture

rajab natshah’s picture

Title: Support Drupal 10 and update all use of deprecations in the CKEditor Anchor Link module » Support Drupal 10 and update all use of deprecation in the CKEditor Anchor Link module
rajab natshah’s picture

Issue summary: View changes
StatusFileSize
new1.83 KB

Further drupal-check on

composer create-project drupal/recommended-project:~9 /var/www/html/sandboxes/drupal9anchor_link

cd /var/www/html/sandboxes/drupal9anchor_link/

composer require drupal/anchor_link

composer require drupal/core-dev --with-all-dependencies
composer require mglaman/drupal-check --dev
composer require phpspec/prophecy-phpunit:^2 --dev 

php vendor/bin/drupal-check -d web/modules/contrib/anchor_link/

Output:

anchor_link--drupal-check--report.txt

 ------ -------------------------------------------------------------------- 
  Line   src/Plugin/CKEditorPlugin/AnchorLink.php                            
 ------ -------------------------------------------------------------------- 
  23     Call to deprecated function drupal_get_path():                      
         in drupal:9.3.0 and is removed from drupal:10.0.0. Use              
           \Drupal\Core\Extension\ExtensionPathResolver::getPath() instead.  
  56     Call to deprecated function drupal_get_path():                      
         in drupal:9.3.0 and is removed from drupal:10.0.0. Use              
           \Drupal\Core\Extension\ExtensionPathResolver::getPath() instead.  
  60     Call to deprecated function drupal_get_path():                      
         in drupal:9.3.0 and is removed from drupal:10.0.0. Use              
           \Drupal\Core\Extension\ExtensionPathResolver::getPath() instead.  
  64     Call to deprecated function drupal_get_path():                      
         in drupal:9.3.0 and is removed from drupal:10.0.0. Use              
           \Drupal\Core\Extension\ExtensionPathResolver::getPath() instead.  
 ------ -------------------------------------------------------------------- 

 ------ -------------------------------------------------------------------- 
  Line   src/Plugin/CKEditorPlugin/FakeObjects.php                           
 ------ -------------------------------------------------------------------- 
  24     Call to deprecated function drupal_get_path():                      
         in drupal:9.3.0 and is removed from drupal:10.0.0. Use              
           \Drupal\Core\Extension\ExtensionPathResolver::getPath() instead.  
 ------ -------------------------------------------------------------------- 

 [ERROR] Found 5 errors                                                         



rajab natshah’s picture

Assigned: rajab natshah » Unassigned
Status: Needs review » Needs work
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
rassoni’s picture

Assigned: Unassigned » rassoni
rassoni’s picture

Version 3.0.x-dev branch not generating any issue.
Please check image for reference.

rassoni’s picture

Assigned: rassoni » Unassigned
StatusFileSize
new227.42 KB

Image

rajab natshah’s picture

No change to code was proposed.
Back to Needs work

rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Assigned: Unassigned » rajab natshah
Status: Needs work » Active
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

✅ Released anchor_link-1.10.0

At this time hoping to have
Works with Drupal: ^8 || ^9 || ^10
and
Works with CKEditor: 4



rajab natshah’s picture

Issue summary: View changes
Issue tags: +anchor_link-1.10.0
rajab natshah’s picture

Kevin had a commit for CKEditor FakeObjects module to support Drupal 10
#3287457: Automated Drupal 10 compatibility fixes

  • Rajab Natshah committed dc19ea35 on 8.x-2.x
    Issue #3277445: TEMP changed drupal/fakeobjects to 1.x-dev in the...

  • Rajab Natshah committed 26e3ef8c on 8.x-2.x
    Issue #3277445: Support Drupal 10 and update all use of deprecations in...
rajab natshah’s picture

Had a Real physical testing round for CKEditor Anchor Link with CKEditor FakeObjects

Using the following bash commands
Real physical testing round for CKEditor Anchor Link with CKEditor FakeObjects.zip

For

  • CKEditor Anchor Link 8.x-1.x branch with Drupal ~9.0
  • CKEditor Anchor Link 8.x-2.x branch with Drupal ~9.0 + CKEditor FakeObjects 8.x-1.x branch
  • CKEditor Anchor Link 8.x-1.x branch with Drupal ~10.0
  • CKEditor Anchor Link 8.x-2.x branch with Drupal ~10.0 + CKEditor FakeObjects 8.x-1.x branch
rajab natshah’s picture

Issue summary: View changes
Issue tags: +anchor_link-2.6.0

Fakeobjects 8.x-1.2 was released on: 26 Jan 2023 by: kevinquillen
https://www.drupal.org/project/fakeobjects/releases/8.x-1.2

Works with Drupal: ^8 || ^9 || ^10


Thanks, Kevin
rajab natshah’s picture

Assigned: rajab natshah » mohammed j. razem
Issue summary: View changes
Status: Active » Needs review
rajab natshah’s picture

Assigned: mohammed j. razem » Unassigned
rajab natshah’s picture

phpcs --standard=Drupal

rajab@vardot-dev:/var/www/html/products/anchor_link$ phpcs --standard=Drupal --extensions=php,inc,install,test,profile,theme,css,info,txt,md,yml,js /var/www/html/products/anchor_link

phpcs --standard=DrupalPractice

rajab@vardot-dev:/var/www/html/products/anchor_link$ phpcs --standard=DrupalPractice --extensions=php,inc,install,test,profile,theme,css,info,txt,md,yml,js /var/www/html/products/anchor_link

rajab natshah’s picture

Version: 3.0.x-dev » 8.x-2.x-dev
rajab natshah’s picture

Had a Real physical testing round for CKEditor Anchor Link with CKEditor FakeObjects

Using the following bash commands bash FRPTR-d10-anchor_link-8-x-2-x.sh ; bash FRPTR-d9-anchor_link-8-x-2-x.sh ;from
Real physical testing round for CKEditor Anchor Link with CKEditor FakeObjects.zip

For

  • CKEditor Anchor Link 8.x-2.x branch with Drupal ~9.0 + CKEditor FakeObjects 8.x-1.2 branch
  • CKEditor Anchor Link 8.x-2.x branch with Drupal ~10.0 + CKEditor FakeObjects 8.x-1.2 branch
rajab natshah’s picture

Status: Needs review » Fixed
rajab natshah’s picture

Issue summary: View changes

✅ Released anchor_link-2.6.0

Status: Fixed » Closed (fixed)

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