Problem/Motivation
Hello project maintainers,
This is an automated issue to help make this module compatible with Drupal 12.
Changes will periodically be added to this issue that remove deprecated API uses. To stop further changes from being posted, change the status to anything other than Active, Needs review, Needs work or Reviewed and tested by the community. Alternatively, you can remove the "ProjectUpdateBotD12" tag from the issue to stop the bot from posting updates.
The changes will be posted by the Project Update Bot official user account. This account will not receive any issue credit contributions for itself or any company.
Proposed resolution
You have a few options for how to use this issue:
- Accept automated changes until this issue is closed
If this issue is left open (status of Active, Needs review, Needs work or Reviewed and tested by the community) and the "ProjectUpdateBotD12" tag is left on this issue, new changes will be posted periodically if new deprecation fixes are needed.
As the Drupal Rector project improves and is able to fix more deprecated API uses, the changes posted here will cover more of the deprecated API uses in the module.
Patches and/or merge requests posted by others are ignored by the bot, and general human interactions in the issue do not stop the bot from posting updates, so feel free to use this issue to refine bot changes. The bot will still post new changes then if there is a change in the new generated patch compared to the changes that the bot posted last. Those changes are then up to humans to integrate.
- Leave open but stop new automated changes.
If you want to use this issue as a starting point to remove deprecated API uses but then don't want new automated changes, remove the "ProjectUpdateBotD12" tag from the issue and use it like any other issue (the status does not matter then). If you want to receive automated changes again, add back the "ProjectUpdateBotD12" tag.
- Close it and don't use it
If the maintainers of this project don't find this issue useful, they can close this issue (any status besides Active, Needs review, Needs work and Reviewed and tested by the community) and no more automated changes will be posted here.
If the issue is reopened, then new automated changes will be posted.
If you are using another issue(s) to work on Drupal 12 compatibility it would be very useful to other contributors to add those issues as "Related issues" when closing this issue.
Remaining tasks
Using the patches
- Apply the latest patch in the comments by Project Update Bot or human contributors that made it better.
- Thoroughly test the patch. These patches are automatically generated so they haven't been tested manually or automatically.
- Provide feedback about how the testing went. If you can improve the patch, post an updated patch here.
Using the merge request
- Review the merge request and test it.
- Thoroughly test the changes. These changes are automatically generated so they haven't been tested manually or automatically.
- Provide feedback about how the testing went. If you can improve the merge request, create a new branch and merge request and work from there.
Warning: The 'project-update-bot-only' branch will always be overwritten. Do not work in that branch!
Providing feedback
If there are problems with one of the changes posted by the Project Update Bot, such as it does not correctly replace a deprecation, you can file an issue in the Drupal Rector issue queue. For other issues with the bot, for instance if the issue summary created by the bot is unclear, use the Project analysis issue queue.
Issue fork geofield-3598572
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
Comment #2
project update bot commentedThis is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.
It is important that any automated tests available are run and that you manually test the changes.
Drupal 12 Compatibility
According to the Upgrade Status module, even with these changes, this module is not yet compatible with Drupal 12.
Currently Drupal Rector, version dev-main, cannot fix all Drupal 12 compatibility problems.
Therefore, these changes did not update the
info.ymlfile for Drupal 12 compatibility.The compatibility issues that Upgrade Status found after the Drupal Rector fixes were applied are attached to help you resolve them manually.
Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot to post additional Drupal 12 compatibility fixes as they become available in Drupal Rector.
Debug information
These packages were used to generate the fixes:
Comment #4
project update bot commentedThis is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.
It is important that any automated tests available are run and that you manually test the changes.
Drupal 12 Compatibility
According to the Upgrade Status module, even with these changes, this module is not yet compatible with Drupal 12.
Currently Drupal Rector, version 1.0.0-beta1, cannot fix all Drupal 12 compatibility problems.
Therefore, these changes did not update the
info.ymlfile for Drupal 12 compatibility.The compatibility issues that Upgrade Status found after the Drupal Rector fixes were applied are attached to help you resolve them manually.
Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot to post additional Drupal 12 compatibility fixes as they become available in Drupal Rector.
Debug information
These packages were used to generate the fixes:
Comment #5
project update bot commentedThis is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.
It is important that any automated tests available are run and that you manually test the changes.
Drupal 12 Compatibility
According to the Upgrade Status module, even with these changes, this module is not yet compatible with Drupal 12.
Currently Drupal Rector, version 1.0.0-beta7, cannot fix all Drupal 12 compatibility problems.
Therefore, these changes did not update the
info.ymlfile for Drupal 12 compatibility.The compatibility issues that Upgrade Status found after the Drupal Rector fixes were applied are attached to help you resolve them manually.
Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot to post additional Drupal 12 compatibility fixes as they become available in Drupal Rector.
Debug information
These packages were used to generate the fixes:
Comment #6
project update bot commentedThis is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.
It is important that any automated tests available are run and that you manually test the changes.
Drupal 12 Compatibility
According to the Upgrade Status module, even with these changes, this module is not yet compatible with Drupal 12.
Currently Drupal Rector, version 1.1.1, cannot fix all Drupal 12 compatibility problems.
Therefore, these changes did not update the
info.ymlfile for Drupal 12 compatibility.The compatibility issues that Upgrade Status found after the Drupal Rector fixes were applied are attached to help you resolve them manually.
Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot to post additional Drupal 12 compatibility fixes as they become available in Drupal Rector.
Debug information
These packages were used to generate the fixes:
Comment #9
nick hope commentedThe pipeline for commit 3e4efe0 reports cspell, PHPCS, PHPStan, and stylelint warnings, and PHPUnit failures.
The commit fixes the PHPCS findings in the two plugin managers and the PHPStan finding in the hook implementation. Local PHP syntax checks, PHPCS on the changed files, and diff checks pass. The PHPStan log no longer reports the changed hook or plugin managers, but the job still reports 45 errors elsewhere, mostly in existing code and unmatched baseline entries. The cspell and stylelint findings are in unchanged files; PHPCS also has findings outside the changed files.
The PHPUnit diagnostics include a `testBoundsWidget` 500 error in core's `field-multiple-value-form.html.twig`, where Twig received an array instead of an escape strategy, and formatter errors where `EscaperRuntime::escape()` received `null` for its autoescape argument. A run with Drupal 11.4.6 and Twig 3.30 produced these errors. They are consistent with the Twig compatibility problem tracked in https://www.drupal.org/project/drupal/issues/3625969, which has since been fixed in core. The `ConstraintsTest` tests for `GeoConstraintValidator` pass. Three other widget assertions could not find the expected `geofield_field` text; I have not established whether those failures are separate from the Twig issue.
After the GitLab Templates update tracked in https://git.drupalcode.org/project/gitlab_templates/-/work_items/3572442, I will manually start a new pipeline and run the Drupal 12 jobs, then check whether the PHPUnit failures remain.
Comment #10
nick hope commentedUpdate: Because of that temporary problem, I pinned automatic pipelines from this branch to Drupal 11.4.8 with CORE_STABLE in .gitlab-ci.yml. Composer, Composer (next major), regular PHPUnit, cspell, ESLint, and stylelint passed.
The Drupal 12-dev 'PHPUnit (next major)' run executed all 41 tests without assertion failures, but the job exited nonzero because of deprecation notices, including notices for plugin annotations scheduled for removal in Drupal 13. PHPCS and PHPStan still report broader project findings, as they do in the standard Drupal 11.4.8 jobs. Targeted checks of the compatibility files pass, and the 'PHPStan (next major)' report does not flag those files.
I also fixed the few reported CSpell and Stylelint findings, a documentation typo, and PHPCS documentation findings in the test file.
Finally, I removed the temporary CORE_STABLE override, and the latest pipeline ran using the just-updated default, with the expected broader PHPCS/PHPStan findings still remaining.
This MR was prepared with AI assistance and definitely needs maintainer review before acceptance.
Comment #11
project update bot commentedThis is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.
It is important that any automated tests available are run and that you manually test the changes.
Drupal 12 Compatibility
According to the Upgrade Status module, even with these changes, this module is not yet compatible with Drupal 12.
Currently Drupal Rector, version 1.1.3, cannot fix all Drupal 12 compatibility problems.
Therefore, these changes did not update the
info.ymlfile for Drupal 12 compatibility.The compatibility issues that Upgrade Status found after the Drupal Rector fixes were applied are attached to help you resolve them manually.
Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot to post additional Drupal 12 compatibility fixes as they become available in Drupal Rector.
Debug information
These packages were used to generate the fixes:
Comment #12
orkutmuratyilmazTested MR !48 on Drupal 12.0.0-beta1 with Mapillary (https://www.drupal.org/project/mapillary), which stores image, sequence, map feature and detection positions in Geofield fields and shows them with Leaflet.
Environment
12.0.0-beta1(Symfony Validator 8.1.8), PHP 8.5.9, PHPUnit 12.5.39, SQLite 3.46.1.codex/3598572-d12-compatibility(a9cfa07a).1.0.0-alpha6.Geofield 10.3.4 is not usable on Drupal 12
10.3.4 declares
^12since #3572547: Add Drupal 12 to core version requirements to allow next major testing, so Composer installs it on Drupal 12. Any code path that builds the constraint plugin definitions (installing config, saving an entity) then stops with a fatal error:PHP Fatal error: Declaration of Drupal\geofield\Plugin\Validation\Constraint\GeoConstraintValidator::validate($value, Symfony\Component\Validator\Constraint $constraint) must be compatible with Symfony\Component\Validator\ConstraintValidator::validate(mixed $value, Symfony\Component\Validator\Constraint $constraint): voidWith 10.3.4, 38 of Mapillary's 52 Kernel classes failed on it.
Result with the MR
validate(mixed $value, Constraint $constraint): voidsignature fixes the fatal error.geometry.latandgeometry.lon.@FieldType,@FieldWidget,@FieldFormatter,@GeofieldBackend,@Constraintand the Views plugins) and return types theDebugClassLoaderasks for on the field type, widget and formatter methods.Given the fatal error, it may be worth a release with this fix before Drupal 12.0.0, since 10.3.4 already claims Drupal 12 support.
Comment #15
itamair commentedHey ... I have not great availability these days to catch up and review everything here.
And everything is looking quite messy over here.
Would it be possible to have a unique MR that wraps and fixes every Drupal 12 compatibility ?
Or, what should be the apply order on the above, otherwise?
Comment #16
tbcs commentedThis comment was drafted by an LLM before it was reviewed by me.
@itamair, !50 is now the single merge request for Drupal 12. It contains:
GeoConstraintValidator::validate()signature fix (a fatal error on Drupal 12 with Symfony 8)GeofieldBackendandGeofieldProximitySourceattribute classes for the two plugin managers (Drupal 12 throws an exception for annotation-only plugin managers)hook_theme()andhook_field_views_data()(Drupal 12 no longer loadsgeofield.views.inc), PHPUnit attributes on the tests, and its lint and CI changesWhere !48 and !50 overlapped (the plugin managers), !50 keeps dedicated attribute classes instead of the
version_compare()branch. Once !50 is merged, !47 and !48 can be closed.Comment #17
itamair commentedthx @tbcs for these clarifications ... will try to find some time to review asap.
In the meanwhile everybody else is welcome to stress test all this on Drupal 12,
and eventually add a +1 to RTBC ...
Comment #18
orkutmuratyilmazI tested !50 on Drupal 12.0.0-beta2 (PHP 8.5). All tests passed, but there were 35 deprecations from Geofield, so the next major job would fail. I pushed three commits on top of !50:
no_uito theGeofieldProximitySourceattribute. Without it, a plugin usingno_uibreaks discovery. Also addPluginDiscoveryTest.@returntags to 60 methods. This removes the deprecations. I did not use native return types, because Leaflet and Geofield Map extend these widgets and would break.Results:
Not tested: Drupal 10.3, Leaflet and Geofield Map.
These commits were done with the assistance of models like Claude Opus 5.5 and Cyber Tiel Coder.
Comment #19
orkutmuratyilmaz@nick hope, @tbcs, can you also review my commits too?
Comment #20
tbcs commented@orkutmuratyilmaz, thanks — I reviewed your commits.
I tested the branch on Drupal 10.3.14 (PHPUnit 9.6), which was missing: all unit and kernel tests pass, including PluginDiscoveryTest, and a temporary kernel test confirmed that every attribute-based plugin (field type, widgets, formatters, constraint, form elements, migrate process plugins, Views handlers) is discovered there. On Drupal 11.5 all tests pass, including the functional widget tests, apart from the JSON:API Extras tests, which need that module.
I ran the Drupal 12 jobs on Gitlab and they had some warnings, so I made a few small changes to the test to make it 100% compatible with Drupal 12.
Comment #21
nick hope commentedThanks both for consolidating and testing this.
I had Codex (GPT-6.1 Sol) review !50 at 769ccb35 and its CI logs. It found the changes sound overall and confirmed all 47 tests passed on Drupal 11 and 12. I haven’t independently rerun them.
Its one suggestion concerns this class-wide suppression:
https://git.drupalcode.org/issue/geofield-3598572/-/blob/769ccb35146afce...
Could handling be limited to the three known JSON:API Extras notices, keeping future Geofield warnings visible? Codex noted that PHPUnit 11 compatibility needs care. Happy to ask it to investigate a small follow-up here, such as replacing the blanket suppression with message-specific ignores and checking both PHPUnit versions.
Comment #22
orkutmuratyilmazThanks @tbcs, for the review and the Drupal 10.3 run, and @nick hope, for the Codex pass.
Well, we have the
#[IgnoreDeprecations]onGeofieldGeoJsonEnhancerTestissue. The three notices come fromResourceFieldEnhancerBasein JSON:API Extras. ItsgetInternalValidator(),getInputValidator()andgetOutputValidator()have no@returntags.I already created a new issue, #3633496: ResourceFieldEnhancerBase triggers return type deprecations on Drupal 12, for this. Once it is fixed there, the attribute can be removed and Geofield has nothing to ignore.
Until then, I am fine with narrowing it to the three messages if that works on both PHPUnit 11 and 12. If it gets complicated, a
@todonext to the attribute pointing to #3633496: ResourceFieldEnhancerBase triggers return type deprecations on Drupal 12 would make clear why it is there and when it can go.Comment #23
orkutmuratyilmazI just created an MR for that issue too.
Comment #25
itamair commentedMR !51 was created upon the MR !50
to remove every Annotation Plugins, both definition and references I found to them.
The Geofield module in this version supports the following Drupal Core(s):
core_version_requirement: ^10.3 || ^11 || ^12
and Attributes plugins were introduced by Drupal core 10.2 ...
Right?
So we should be able to get rid of Annotations plugins.
(I manually tested MR !51 with a clean Drupal 10.3 instance and everything looked working fine ... apparently)
Comment #26
nick hope commentedThanks for opening the upstream fix. A TODO linking to it sounds reasonable while it’s pending.
To help answer #25, I asked Codex (GPT-6.1 Sol) to create a small test module containing annotation-based backend and proximity-source plugins, and check whether Geofield still discovers them. On Drupal 11.4.11 and Drupal 12-dev, !50 passes all eight discovery cases. With the same test patch, !51 passes the six existing cases, but both new cases fail because the annotated plugins are missing from discovery.
So this implies that removing the fallbacks would break discovery of existing annotation-based plugins supplied by other modules (including custom modules that aren’t publicly available). Retaining them would preserve that compatibility while we get the D12 fixes merged. Drupal’s migration guidance also recommends retaining the annotation class alongside the attribute class for existing plugin types, to avoid backwards-compatibility breaks: https://www.drupal.org/node/3395582
I’ve pushed the test-only change as commit 43430d8, available to be incorporated into whichever MR goes forward, if useful: https://git.drupalcode.org/issue/geofield-3598572/-/commit/43430d831e860...
No production code changed; expected annotation deprecations are checked explicitly. I haven’t independently rerun these tests outside Codex.
Comment #27
itamair commentedthanks @nick hope ... definitely agreed.
MR51! cancelled/removed ...
Comment #30
itamair commentedI run some major cleanup ... (there were too many MRs and branches, etc.).
AI coding agents are producing too much and quick code and is very hard to stay after and aligned with all this.
Let's keep the MR!50 the unique one here ... as according @tbcs it should be considered that way.
@tbcs up to you if the latest "codex/3598572-legacy-discovery-test" branch by @nick hope looks not obvious / redundant and should also be merged.
That said, all looks great work and update in the Geofield module and its D12 compatibility on MR!50, at the moment,
with all tests passing.
Let me know when that is finally ready to be merged into the 10.3.x branch (as it looks to me).
Comment #31
tbcs commentedYeah, those changes look reasonable and minimal enough. Cherry-picked.
Comment #32
itamair commentedOk, let's go. All this looks pretty solid.
Merging MR !50 into 10.3.x branch ...
Comment #34
itamair commentedComment #36
itamair commentednew geofield 10.3.5 release just deployed with this ...
Comment #37
orkutmuratyilmazthanks for the fix:)