Incompatibility with many themes but Claro

Created on 7 September 2024, 4 months ago
Updated 20 September 2024, 4 months ago

I am testing out Drupal after years of experience with WordPress. The strongest motivator was the performance, but without the Gutenberg module, I wouldn't have considered Drupal, so I really appreciate the hard work on this module.

But, I have trouble establishing compatibility. Except Claro theme, I have trouble loading the contents editor page. I can see 'loading' sign w/ a rolling circle at the center of screen, and it stays there forever. Even Gutenberg Starter theme also had the same issue. W/ Claro, I can see half of the Claro's top bar in the Gutenberg editor screen as well.

The choice of admin theme (w/ disabling 'Use the admin theme for editing/creating content') does not affect the functionality, so I believe it is highly related to Gutenberg module's compatibility with editor page's underlying theme.

I've tried to find the debugging option, but it seems like I am not experienced enough to find the proper debug log for this partiucular error. Just in case you wonder, I did purge all caches in performance tab multiple times.

The best would be to help me to locate the supposed error log, or alternatively you can replicate my setting. I am on Drupal 10.3.3 w/ Nginx 1.27.1, PHP 8.2.23, and Postgre 16 (Ubuntu 16.4-1.pgdg22.04+1). The issue wasn't present w/ Drupal 11.0.2 w/ PHP 8.3.11, but without many necessary modules for my transition to Drupal, I am unsure if I would be willing to go forward with the cutting edge version yet.

🐛 Bug report
Status

Active

Version

3.0

Component

User interface

Created by

🇰🇷South Korea keithkhl

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇵🇹Portugal marcofernandes

    The problem is that, in order to provide the full editing experience, we have to do some alters on the node/entity edit form. But, if a theme (admin) also does alter the same form, it has priority and might override Drupal Gutenberg's changes. For example, if a theme provides a node edit form template a bit different from Claro, it is enough to break Gutenberg.
    We're trying several options in 📌 Entity type agnostic Active to mitigate this issue.

  • 🇷🇺Russia gease Praha

    Ok, since people are aware and working on that, I will not attach a patch, just a snippet from claro theme that should make custom theme work with Gutenberg (as a temporary solution)

    /**
     * Implements hook_form_BASE_FORM_ID_alter() for \Drupal\node\NodeForm.
     *
     * Changes vertical tabs to container.
     */
    function claro_form_node_form_alter(&$form, FormStateInterface $form_state) {
      $form['#theme'] = ['node_edit_form'];
      $form['#attached']['library'][] = 'claro/form-two-columns';
    
      $form['advanced']['#type'] = 'container';
      $form['advanced']['#accordion'] = TRUE;
      $form['meta']['#type'] = 'container';
      $form['meta']['#access'] = TRUE;
    
      $form['revision_information']['#type'] = 'container';
      $form['revision_information']['#group'] = 'meta';
      $form['revision_information']['#attributes']['class'][] = 'entity-meta__revision';
    }
    
  • 🇰🇷South Korea keithkhl

    Where to add that function? Guess I have to change the library 'claro/form-two-columns' to something else.

  • 🇰🇷South Korea keithkhl

    After setting a Bootstrap theme for default, I cannot access editor even with Claro as the admin theme (w/ editor option checked).
    In the dev console, I can see that calls for files are made, and status were all 200, but the screen body got covered by the Bootstrap js.
    The entity type agnostic ( https://www.drupal.org/project/gutenberg/issues/3445655 📌 Entity type agnostic Active ) should take this into account.

  • 🇷🇺Russia gease Praha

    @keithkhl no, you don't need to change the claro/form-two-columns library
    The simplest thing is to implement the same hook in your theme file (yourtheme.theme) and to call claro hook from there

    function yourtheme_form_node_form_alter(&$form, FormStateInterface $form_state) {
      claro_form_node_form_alter($form, $form_state);
    }
    

    and declare dependency on claro in yourtheme.info.yml:
    dependencies:
    dependencies:
    - core/claro

    This is a rather dirty hack, but so far we don't have anything better.

  • 🇰🇷South Korea keithkhl

    @gease, thx bunch. haven't thought about that. as long as claro stays in the system, like sub-themes.

  • 🇰🇷South Korea keithkhl

    @gease, I've tried the function as a custom module on Gin Admin and Bootstrap 5 admin themes, but it doesnt work on either. I revert back to Claro for now.

    To the team, as a long time WordPress user w/ heavy dependence to Gutenberg, I deeply appreciate the hard work on this. However, with current setting, I become wary of every single module potentially discharge me from node editor with Gutenberg.

    Whatever the functional mod to the admin theme is implemented, like experimental navigation bar module for example, I cannot use Gutenberg editor anymore.

    I can further customize CSS on a Claro sub theme for UI, but I would much appreciate if there is an official sub module that overrules each theme's node editor customization. At least it was like that with WordPress by default.

  • 🇰🇷South Korea keithkhl

    @gease, I fixed it. Don't know why, but dependency to 'claro' did not read the theme. I added the full function into the code. So, as long as Claro is not removed, the function should work. I've confirmed a number of admin themes (Gin admin, Bootstrap admin, and D10's administration theme). Attached the 'dirty hack', in case anyone get in trouble like me.

  • 🇷🇺Russia gease Praha

    I made a mistake in previous comment, dependecy should read

    dependencies:
    - claro

    not

    dependencies:
    - core/claro

  • Pipeline finished with Success
    4 months ago
    Total: 153s
    #291533
  • First commit to issue fork.
  • Merge request !200Add some tests → (Merged) created by eiriksm
  • 🇳🇴Norway eiriksm Norway

    So to resolve this issue we would need a minimal reproducible theme.

    I have opened a MR with adding tests for 3 core themes, and that we can load the editor when they are set as the admin theme. At least locally for me, they all work.

    Could someone contribute to this issue with producing the absolute minimum of an example theme making it incompatible (like in the description)?

  • 🇳🇴Norway eiriksm Norway

    Setting to "needs work" because we need that test case still, and after we have that, I am sure we can resolve this once and for all 🤓️

  • 🇷🇺Russia gease Praha

    @eiriksm Please read my comments.
    Theme is incompatible, if it does not render node form through node_edit_form theme hook.

  • Pipeline finished with Success
    4 months ago
    Total: 348s
    #292409
  • 🇳🇴Norway eiriksm Norway

    Your comments are a great resource towards fixing it, thanks for that!

    What I am looking for is an example theme we can put into the tests. Well I guess I found an example myself.

    name: test theme
    type: theme
    base theme: false
    core_version_requirement: ^10 || ^11
    

    This one file for a theme seems to trigger the problem

  • Pipeline finished with Failed
    4 months ago
    Total: 327s
    #292440
  • 🇳🇴Norway eiriksm Norway

    I now have passing tests (locally at least) and I believe this should fix the issue for anyone in this thread. Would be great if someone could verify this ✌️

  • Pipeline finished with Failed
    4 months ago
    Total: 296s
    #292549
  • Pipeline finished with Success
    4 months ago
    Total: 346s
    #292557
  • Pipeline finished with Success
    4 months ago
    Total: 357s
    #292579
  • Pipeline finished with Success
    4 months ago
    Total: 333s
    #294050
  • Merge request !201Remove extra space → (Merged) created by marcofernandes
  • Pipeline finished with Canceled
    4 months ago
    Total: 77s
    #294182
  • Pipeline finished with Success
    4 months ago
    Total: 317s
    #294184
  • Pipeline finished with Success
    4 months ago
    Total: 301s
    #294192
  • Pipeline finished with Success
    4 months ago
    Total: 1053s
    #299072
  • Pipeline finished with Skipped
    4 months ago
    #299089
  • Pipeline finished with Success
    4 months ago
    Total: 1001s
    #301028
  • Pipeline finished with Failed
    3 months ago
    Total: 590s
    #302293
  • Pipeline finished with Success
    3 months ago
    Total: 1170s
    #302313
  • Pipeline finished with Success
    3 months ago
    Total: 1290s
    #302336
  • Pipeline finished with Failed
    3 months ago
    Total: 1169s
    #302525
  • Pipeline finished with Failed
    3 months ago
    Total: 979s
    #302536
  • Pipeline finished with Failed
    3 months ago
    Total: 1155s
    #303018
  • Pipeline finished with Failed
    3 months ago
    Total: 970s
    #303107
  • Pipeline finished with Failed
    3 months ago
    Total: 1950s
    #303211
  • Pipeline finished with Success
    3 months ago
    Total: 1041s
    #303358
  • Pipeline finished with Failed
    3 months ago
    Total: 1908s
    #304316
  • Pipeline finished with Failed
    3 months ago
    Total: 1042s
    #304634
  • Pipeline finished with Failed
    3 months ago
    Total: 1327s
    #305475
  • Pipeline finished with Failed
    3 months ago
    Total: 988s
    #305581
  • Pipeline finished with Failed
    3 months ago
    Total: 1079s
    #306036
  • Pipeline finished with Failed
    3 months ago
    Total: 1347s
    #306308
  • Pipeline finished with Failed
    3 months ago
    Total: 1187s
    #306541
  • Pipeline finished with Success
    3 months ago
    Total: 2384s
    #306562
  • Pipeline finished with Success
    3 months ago
    Total: 1434s
    #306599
  • Pipeline finished with Success
    3 months ago
    #311921
  • Pipeline finished with Success
    3 months ago
    #311925
  • Pipeline finished with Success
    3 months ago
    Total: 219s
    #312282
  • Pipeline finished with Failed
    2 months ago
    #331995
  • Pipeline finished with Failed
    2 months ago
    Total: 2594s
    #331993
  • Pipeline finished with Failed
    2 months ago
    Total: 33s
    #332070
  • Pipeline finished with Failed
    2 months ago
    Total: 82s
    #332069
  • Pipeline finished with Failed
    2 months ago
    Total: 33s
    #332093
  • Pipeline finished with Failed
    2 months ago
    Total: 33s
    #332223
  • Pipeline finished with Success
    2 months ago
    Total: 129s
    #332236
  • Pipeline finished with Failed
    2 months ago
    Total: 138s
    #332238
  • Pipeline finished with Canceled
    2 months ago
    #332258
  • Pipeline finished with Success
    2 months ago
    Total: 142s
    #332261
  • Pipeline finished with Success
    2 months ago
    Total: 60432s
    #332298
  • Pipeline finished with Skipped
    2 months ago
    #339810
  • Pipeline finished with Canceled
    about 2 months ago
    Total: 138s
    #344643
  • Pipeline finished with Success
    about 2 months ago
    Total: 204s
    #344644
  • Pipeline finished with Success
    about 2 months ago
    Total: 144s
    #344649
  • Pipeline finished with Success
    about 1 month ago
    Total: 1429s
    #366737
  • Pipeline finished with Failed
    about 1 month ago
    Total: 408s
    #366766
  • Pipeline finished with Failed
    about 1 month ago
    Total: 1260s
    #367072
  • Pipeline finished with Failed
    about 1 month ago
    Total: 6363s
    #367469
  • Pipeline finished with Success
    about 1 month ago
    Total: 1074s
    #367624
  • Pipeline finished with Success
    about 1 month ago
    Total: 2602s
    #367641
  • Pipeline finished with Success
    29 days ago
    Total: 340s
    #375775
  • Pipeline finished with Success
    27 days ago
    Total: 339s
    #376602
  • Pipeline finished with Success
    13 days ago
    Total: 435s
    #387192
  • Pipeline finished with Skipped
    13 days ago
    #387233
Production build 0.71.5 2024