Note sure if this is a duplicate issue of this, if so we can close this.
https://www.drupal.org/project/patternkit/issues/3113545

Steps to reproduce
- Use Drupal core 9.2.5
- Applied the fix patch https://www.drupal.org/files/issues/2021-11-03/2946333-9.2.x-260.patch, so you don't have to use layout_builder_st.
- Enable locale
- Enable content_translation
- Enable patternkit
- Enable config_translation
- Create a content with layout builder enable
- Save the node
- Go to layout and add in a patternkit block
- Now save the layout
- Click on the translation tab and add another translation
- Click save to save that node in another translation
- Click the layout tabs
- Hover over the pattern kit block and hit translate.
- Notice only field visible is the description field.

The pattern kit field should be all visible and allow for translation.

Things I've notice is the javascript does not load when doing the translation.

Issue fork patternkit-3251763

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

johnle created an issue. See original summary.

cyb_tachyon’s picture

Assigned: Unassigned » cyb_tachyon

I am now working on a patch.

cyb_tachyon’s picture

Code in review :)

johnle’s picture

So i've debug this issue, and it's failing at

class_exists('Drupal\patternkit\PatternTranslationHandler');

I've confirmed the file is there and the namespace is correct. I've tested this with some of the classes that are in that directory and they all seem to work except for this one.
When I restart by docker instance, it worked, which leads me to believe it maybe a file caching issue not discovering the new class that was added. I've thought a drush cr would do the trick but looks like it may need to also do a registry rebuild of some sort?

johnle’s picture

Issue summary: View changes
johnle’s picture

@cyb.tachyon
Ah cool let me re-test that with the hook update and get the patch updated once that works. Thanks.

johnle’s picture

I was not able to reproduce the InvalidPluginDefinitionException any longer for me to test this patch. @cyb.tachyon, if you still have that error, you mind testing out the latest changes with the updb?

johnle’s picture

Looks like there is a bug where when it is adding a new block for a new translation, it flag the new patternkit block as the new source. This is not the same behavior that core content block does its. We don't see the issue here, but when trying to use other modules this can break when loading the patternkit block.

johnle’s picture

Adding the diff patch from the merge request.

mariohernandez made their first commit to this issue’s fork.

  • mariohernandez committed 670c03e on 9.1.x authored by johnle
    Issue #3251763 by johnle: Unable to translate the patternkit block via...
mariohernandez’s picture

Assigned: cyb_tachyon » mariohernandez
Status: Active » Reviewed & tested by the community

Successfully tested patch with core version 9.3.3.

mariohernandez’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

mariohernandez’s picture