Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some fixes for Drupal 11.0.x compatibility #4354

Draft
wants to merge 30 commits into
base: 2.x
Choose a base branch
from
Draft

Some fixes for Drupal 11.0.x compatibility #4354

wants to merge 30 commits into from

Conversation

dafeder
Copy link
Member

@dafeder dafeder commented Dec 9, 2024

Fixes #4356

To build from scratch, need to do some steps. LMK if these don't work, doing this from memory a bit. We should not merge this until select2 has an official D11 release and we can remove the composer-lenient hack from recommended-project.

  1. Use ddev workflow and pull in 11.0.x branch of recommended-project. See updated README on that branch,
  2. Composer will fail. Remove dkan and select2 from require section.
  3. composer install
  4. Add select2 back, and composer install (use update if this fails
  5. Add dkan back, and composer update

Changes of note:

  • Full removal of Drupal's ContainerAwareEventDispatcher
  • Full removal of DKAN's LoggerTrait
  • Many PHPUnit data provider functions changed to be abstract
  • Replaced many calls to getMockForAbstractClass to simply getMock() due to deprecation. This also meant mocking, for instance, SQLite connection class instead of just the abstract connection class.
  • No more use of StatementWrapper in Drupal queries

@dafeder
Copy link
Member Author

dafeder commented Dec 10, 2024

Update: as of last push, fixed many errors, but still getting some from:

  • Drupal\Tests\dkan_js_frontend\Unit\SimpleSitemapArbitraryLinksAlterTest
  • Drupal\Tests\metastore_search\Unit\SearchTest
  • Drupal\Tests\metastore\Kernel\DataDictionarySettingsFormTest
  • Drupal\Tests\metastore\Unit\MetastoreServiceTest

Also will need

  • to re-run with --display-phpunit-deprecations to make sure there are no more of those
  • search whole repo for getMockForAbstractClass() which should really be replaced now
  • check for other deprecations in linter

@dafeder
Copy link
Member Author

dafeder commented Dec 12, 2024

Only test failing at this point seems to be AdminDatasetFileUploadTest::testCreateDatasetWithFileUpload(). I think this is related to something wrong with select2; I also see issues with the form when loading in my browser. May put this aside until there is a proper select2 release for D11.

@dafeder dafeder changed the title Trying some D11 compatibility Add Drupal 11.0.x compatibility Dec 12, 2024
@dafeder dafeder marked this pull request as ready for review December 16, 2024 19:28
@dafeder dafeder marked this pull request as draft December 16, 2024 19:30
@dafeder
Copy link
Member Author

dafeder commented Dec 19, 2024

Another option, probably better - once all tests pass, revert changes to info.yml files and merge this, so that the other fixes don't get stale.

@dafeder dafeder changed the title Add Drupal 11.0.x compatibility Some fixes for Drupal 11.0.x compatibility Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drupal 11 Compatibility
1 participant