- Issue created by @mesharideb
- πΊπΈUnited States goose2000
Thank you, just want to confirm this patch applied and fixed this command on my webform 6.2.7
The patch has commented-out code and I think the added code comments are unnecessary because the code is obvious.
I am marking this "Novice" in case a novice contributor wants to do that.
- πΈπ¦Saudi Arabia mesharideb
Teaching new contributors to delete comments from working fixes" isn't listed as a recommended learning experience. Should we update the docs or rethink our approach?
Anyway, here's the updated patch
- π¨π¦Canada Liam Morland Ontario, CA π¨π¦
Please make an issue fork and merge request targeting 6.3.x.
- Merge request !535Issue #3470339 by mesharideb: Fix composer update issue by treating... β (Open) created by mesharideb
- π¨π¦Canada Liam Morland Ontario, CA π¨π¦
The documentation says that
$repositories
is supposed to be an object. Do you have an understanding of why it is not an object? What happens if you add anobject
type declaration? If it is supposed to be an array, the docblock needs to be updated and a type declaration added. - Status changed to Needs review
21 days ago 5:30pm 25 October 2024 In Composer you can declare repositories either way. By default itβs an array.
- π¨π¦Canada Liam Morland Ontario, CA π¨π¦
So the code needs to be able to accept either? Should it ensure that it doesn't change from object to array or vice-versa?
- πΈπ¦Saudi Arabia mesharideb
In the last commit, refactored WebformLibrariesCommands to use associative arrays for handling composer.json, which aligns better with PHPβs handling of JSON. Removed object casts, added JSON error checks, cleaned up _webform properties, and added a check to prevent duplicate repositories. This improves type safety, simplifies the code... Tested and working as expected.
- πΊπΈUnited States kreynen
The latest changes from https://git.drupalcode.org/project/webform/-/merge_requests/535.diff as a new patch
- πΊπΈUnited States kreynen
I ran into this error, Googled and ended up here. After applying https://www.drupal.org/project/webform/issues/3470339#comment-15829504 π Error: Attempt to assign property on array in WebformLibrariesCommands->setComposerLibraries() Active I was able to run `ddev drush webform:composer:update`. I tried creating a patch from the latest changes, but that wouldn't apply. Could be an issue with the way I generated the patch.
Hi, everybody, i confirm:
the patch in : https://www.drupal.org/project/webform/issues/3470339#comment-15744580 π Error: Attempt to assign property on array in WebformLibrariesCommands->setComposerLibraries() Active (#4)
worked for webform module 6.2.2 in drupal 10.3.6
Thanks for this work.