Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The google_tag.container configuration entities have an incomplete configuration schema.
Proposed resolution
Fix the google_tag.container config entity schema.
Remaining tasks
- Write a patch
- Review
- Commit
User interface changes
None.
API changes
To be determined.
Data model changes
To be determined.
Comment | File | Size | Author |
---|---|---|---|
#19 | 3069679-19.patch | 6.11 KB | slasher13 |
#19 | interdiff.txt | 1.75 KB | slasher13 |
#12 | Sélection_069.png | 20.08 KB | steveoriol |
#5 | interdiff.txt | 360 bytes | askibinski |
#5 | 3069679-5.patch | 4.37 KB | askibinski |
Comments
Comment #2
askibinski CreditAttribution: askibinski at ezCompany for Erasmus University Rotterdam commentedComment #3
askibinski CreditAttribution: askibinski at ezCompany for Erasmus University Rotterdam commentedHere is the same schema but for one schema.yml file. Seems the way core prefers it.
Comment #4
idebr CreditAttribution: idebr at ezCompany commentedThis works really nice!
Some remarks:
Without any configuration schema, the label property is a type: label and is translatable. A string is not translatable, so this could lead to data loss.
Comment #5
askibinski CreditAttribution: askibinski at ezCompany for Erasmus University Rotterdam commentedHere's a new patch which keeps the type of the label property 'label' instead of string.
Comment #6
askibinski CreditAttribution: askibinski at iO for Erasmus University Rotterdam commentedComment #7
idebr CreditAttribution: idebr at ezCompany commentedNice! Still needs work for #4.2
Comment #8
solotandem CreditAttribution: solotandem commented@idebr
On what basis do you mark this issue as a bug? What do you claim does not work with the current code?
You claim an "incomplete" configuration schema. How so?
@idebr, @askibinski
Why do either of you regard the suggested change as making the schema complete? Please elaborate on the rationale for the changes.
Comment #9
idebr CreditAttribution: idebr at ezCompany commentedDrupal Core's PHPUnit based automated tests check configuration data for the existence of a configuration schema and will trigger an error when a configuration schema is missing. As a result, developers cannot include any Google Tag Containers in their automated testing.
A more complete description of what the configuration schema is used for is available at https://www.drupal.org/docs/8/api/configuration-api/configuration-schema...
Comment #10
solotandem CreditAttribution: solotandem commentedAgain, that is a general statement. Would you provide evidence that it applies to this project? Also, would you reply to the other questions posed ?
Comment #11
idebr CreditAttribution: idebr at iO commentedSure, I could write an automated test to show the current behavior if you like? I searched the issue queue if there was an open task for it but I could not find any.
You would have to enable testing on the 'Automated testing' tab on the project page for it to run on the Drupal.org testing infrastructure: https://www.drupal.org/node/2199963/qa
Comment #12
steveoriolDoes this problem have something to do with the following error that I find in the page "/admin/reports/status" ?
Comment #13
EdPhillis CreditAttribution: EdPhillis commentedYes, Im here like Steve, with the same error. Im guessing it is. Drush entup doesnt fix the problem like it normally does with mismatched entities.
Comment #14
solotandem CreditAttribution: solotandem commented@steveoriol, @olomouc
Are you running latest dev (or 8.x-1.2)? Did you run database updates?
Comment #15
miikamakarainen CreditAttribution: miikamakarainen commentedI have the same issue with mismatched entity/field definitions as Steveorio and Olomouc am running 8.x-1.2 (8.x-1.1 before update) and have ran database updates.
Comment #16
steveoriol@solotandem, I am in version 8.x-1.2 (8.x-1.1 before update), and I have also do run the drush updb ...
Comment #17
parisekHad same problem with update to 8.x-1.2, resolved with module reinstall
Comment #18
steveoriolthanks parisek, it works for me too, it's just a pity to reinstall and configure for each site ...
Comment #19
slasher13addressed #4.2 and #12
Comment #20
shepparddigital CreditAttribution: shepparddigital commentedI applied slasher13's patch to a Drupal 8.7.7 site and it has resolved the problem. Thanks.
Comment #21
xeM8VfDh CreditAttribution: xeM8VfDh commentedI'm here same as @steveoriol (#12), @olomouc (#13), and @miikamakarainen (#15)
I'm running Drupal 8.7.7 and GTM 8.x-12.
drush entity:updates
does not work. When I run it it says: "The Container configuration entity type needs to be installed.". But, answering yes and going along with the installation doesn't resolve the issue. No errors are thrown, but when I try to update entitites again, expecting no more problems, the same message about having to install this GTM entity is shown. Answer yes again, again not fixed.I have run database updates.
Is the solution to either reinstall or wait for this path to be released?
Comment #22
solotandem CreditAttribution: solotandem commentedThis issue concerns the claim of an 'incomplete config schema' implying it is invalid and as a result something is not working as expected with the module code (i.e. the definition of a bug). This claim is unsubstantiated. Further, the suggested changes to the schema yaml files (in patches 2,3 and 5) would render the schema inconsistent with the implementing code in the project.
Comment #12 introduces a separate issue, namely the need to 'install' the 'google_tag_container' entity type. A separate issue has been created for this topic. See #3081007: Officially 'install' the 'google_tag_container' entity type. Comments 12-21 apply to the new issue. Any additional comments on this topic should be added to the new issue.
Comment #23
solotandem CreditAttribution: solotandem commentedIn the process of writing tests I encountered the schema error mentioned in #9 and implied in the substance of the issue. Thank you all for reporting and commenting. That said I did not change the schema in all respects as suggested by the patch files. I retained the
_google_tag_container
type and its use ongoogle_tag.settings
. (This structure is consistent with the settings form code, what is stored in the config table, and does not cause errors in the tests.) We agree on adding the container properties to thegoogle_tag.container.*
schema. The latter changes make the schema consistent with the container entity definition and the container form. As an aside, I find it rather odd that Drupal does not complain about the schema except when running tests.On the topic of 'installing' the container entity type, the
google_tag.post_update.php
code in patch #19 appears unnecessary as the existing configuration entities agree with the revised schema. In essence the saved container configuration agrees with the schema changes (i.e. the schema was out of sync with the entity). If I am missing something here and someone can demonstrate otherwise, please create an issue for same (or comment on issue 3081007 [intentionally not linked to again]).The schema changes commit does not refer to this issue as it should. That was my oversight in getting into the test writing and remembering this issue afterwards.