Problem/Motivation

Site admins unable to manage form display because of the fatal error:

Fatal error: Class 'Drupal\paragraphs_asymmetric_translation_widgets\Plugin\Field\FieldWidget\ParagraphsAsymmetricWidget' not found in /var/www/html/docroot/modules/contrib/rocketship_core/src/Plugin/Field/FieldWidget/RSParagraphsAsymmetricWidget.php on line 21

This happens because ParagraphsAsymmetricWidget is not committed to HEAD yet, but added in #2959900: Add support for experimental widget.

Proposed resolution

Document the need to patch paragraphs_asymmetric_translation_widgets to use RSParagraphsAsymmetricWidget

Remaining tasks

Write the patch

CommentFileSizeAuthor
#6 3065626-6.patch1.28 KBvalthebald
#5 3065626-5.patch1.73 KBvalthebald

Comments

valthebald created an issue. See original summary.

grayle’s picture

Issue summary: View changes

The class it extends exists only in a patch, currently the patches are only set in the parent distribution (https://www.drupal.org/project/dropsolid_rocketship).

iirc patches can, however, also be set in lower composer files so if you want to make a patch that adds the composer.json patches part from Rocketship into this module, go for it.

grayle’s picture

Status: Active » Fixed

Alright, moved the two required patches from the distribution to this module. Beta10 should have all it needs.

valthebald’s picture

Status: Fixed » Active

That was fast :)

valthebald’s picture

Status: Active » Needs review
StatusFileSize
new1.73 KB

Unfortunately, composer-patches plugin doesn't work that way - at least in default configuration.

It only takes patches that are specified in the top level composer.json (there are multiple reasons for this behavior), so having the patch in distribution project like dropsolid_rocketship makes total sense.

I have performed `composer require drupal/rocketship_core` with drupal-composer template (which includes cweagans/composer-patches) just to be sure, and ended up with no required base class.

Also, not all projects use composer flow (or composer-patches plugin).

I suggest to (re)-add the patch to the distribution, and add a comment to RSParagraphsAsymmetricWidget

valthebald’s picture

StatusFileSize
new1.28 KB

of course, using the right base class

grayle’s picture

Status: Needs review » Needs work

All you need is this in your top-level to make dependency patching work:

"extra": {
"enable-patching": true
}

Maybe you were thinking of defining repositories in dependencies. Although it indeed doesn't seem 100%, sometimes it needs two update calls. I haven't looked into the logic of composer-patches, but it looks like it reads stale local composer files... sometimes.

Extra information is always good though. But it also requires a core patch, so best to include that information as well. I'll update some more READMEs this week as well to include more composer info flow, especially regarding patches.

valthebald’s picture

Issue summary: View changes

Updated issue summary

  • Grayle committed ba05739 on 8.x-1.x
    Issue #3065626 by valthebald, Grayle: RSParagraphsAsymmetricWidget...
grayle’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.