🇬🇧United Kingdom @paulmartin84

Account created on 30 July 2012, over 12 years ago
  • Technical Team Lead at Inviqa 
#

Recent comments

🇬🇧United Kingdom paulmartin84

This patch fixes the newly introduced error, but doesn't address the issues of not being able to deselect a story or the hardcoded field name.

🇬🇧United Kingdom paulmartin84

This has broken the shorthand module completely and stories can no longer be selected.

if (option.value == 0) {

was changed to:

if (option.value === 0) {

However the zero is actually a string so now it fails to be excluded and then causes the following error
TypeError: Cannot read properties of undefined (reading 'description'), so either need to be changed back or changed to === '0'

While this part is being addressed, we shouldn't be excluding zero anyway. Once a story has been selected, there is currently no way to unselect all stories and set it back to 0 The field doesn't have to be set as a a required nor should it have to be be.

The code also has a hardcoded field name in it, which is just not acceptable in a Drupal module. Users should be free to name their fields as they wish.

I'll create a new issue for all of the above, but just putting it here, incase people are wondering why this issue has broken something

🇬🇧United Kingdom paulmartin84

Hopefully this is the final change, I have noticed that URLs containing percentage encoded characters are getting double encoded.
The final solution isn't that clean, but not sure much else can be done.

🇬🇧United Kingdom paulmartin84

I have spotted another issue with the above parsing method. URLs that contain multiple query strings will have & instead of &.

Accoring to https://www.drupal.org/project/entity_embed/issues/2973178 this is correct.

This causes parse_url not to work correctly, so I have added decoding and re-encoding the url to work around this.

🇬🇧United Kingdom paulmartin84

Sorry I made a small mistake in the last patch, This is correct now

🇬🇧United Kingdom paulmartin84

The attached patch fixes the query string issue mentioned in #8 and also handles a url fragment should it exist.

🇬🇧United Kingdom paulmartin84

I've spotted an issue with the above fix, I've opened a separate issue here https://www.drupal.org/project/tmgmt/issues/3370882 🐛 Paragraphs translations aren't always updated Fixed
Basically the above is calling $target_entity->needsSave(); which is a getter rather than a setter, I believe it should be calling $target_entity->setNeedsSave(TRUE);

Production build 0.71.5 2024