- Issue created by @scott_euser
- π¬π§United Kingdom scott_euser
scott_euser β changed the visibility of the branch 3458431-typed-config-dx to hidden.
- Merge request !8625Issue #3458431: Improve developer experience for 10.3.x upgrade by informing where typed config fails β (Open) created by scott_euser
- π¬π§United Kingdom scott_euser
scott_euser β changed the visibility of the branch 3458431- to hidden.
- Status changed to Needs review
5 months ago 5:41am 2 July 2024 - π¬π§United Kingdom scott_euser
The result in a failure is now something like:
> AssertionError: Failed on config name: unified_date.settings in /var/www/html/web/core/modules/system/system.post_update.php on line 265 #0 /var/www/html/web/core/modules/system/system.post_update.php(265): assert(false, 'Failed on confi...')
Which helps the developer know which module they need to check.
- π¬π§United Kingdom scott_euser
This is only really useful if we target 10.3.x, hopefully it is a trivial enough change, but I expect it will save a lot of hair pulling and extra support request from developers who don't know where to look and then e.g. raise it in Drupal Slack/Drupal Stack Exchange/issue queues/etc.
- π¬π§United Kingdom scott_euser
Unfortunately not, the post update hook it applies to was removed in 11.x (I think because we require people to upgrade to 10.3.x before 11.x)
- Status changed to RTBC
5 months ago 4:58pm 2 July 2024 - π¬π§United Kingdom scott_euser
Thanks, just an FYI you can download the patches locally as per the recommendations here β , so hiding the patch.
- Status changed to Needs work
5 months ago 2:31am 5 July 2024 - π³πΏNew Zealand quietone
Adding a message to help developers is usually a good idea. The use of t() should be removed though.
- Status changed to Needs review
5 months ago 4:21am 5 July 2024 - π¦πΊAustralia mstrelan
I guess that's better, but it would be good if you can see what
$typed_config
actually is where it's failing for you. It's not clear to me if contrib modules are doing something wrong, or if this post update hook is making incorrect assumptions about the config it's trying to update. If the latter, then we should try to fix it. - π¬π§United Kingdom scott_euser
Its definitely the former; for example in one of my modules, I had the type set to sequence and had to change it to config_object + adding mapping https://git.drupalcode.org/project/unified_date/-/commit/b40d053b77e3f24...
It certainly seems that this is a common problem (maybe we are all copy pasting from each other or maybe there is an outdated doc page - will try to unpick that - but I do not think it should block getting this in though). When you see the error + know the config name, a quick search picks up many similar results allowing the developer to sort the issue. Some more examples of results that come up for the same issue as the above with unified_date:
- π Config schema is incorrect Active
- π AssertionError: assert($typed_config instanceof Mapping) in assert() Active
- π Config schema is incorrect Active
I expect this issue will show up in a search as well giving hints as to how to solve. Without the config name indicating the failure though, its much harder for the developer to know which module to look at.
- π¬π§United Kingdom scott_euser
Searching around I cannot see examples any more of it in the docs. The only thing I could find is a note about it here: https://www.drupal.org/docs/drupal-apis/configuration-api/configuration-... β if you control+f for "deprecated.sequence.definition.format:". Ie, it looks like the documentation is correctly updated.
- Status changed to RTBC
4 months ago 1:50pm 11 July 2024 - Status changed to Fixed
4 months ago 11:10pm 12 July 2024 - π¬π§United Kingdom catch
Committed/pushed to 10.4.x and cherry-picked to 10.3.x, thanks!
Automatically closed - issue fixed for 2 weeks with no activity.