- Issue created by @Foxy-vikvik
- π§πͺBelgium StryKaizer Belgium
When using GIN + layout builder, this is a known issue.
A fix for this is to implement hook_form_alter in a custom module, and do something like this.
PS: we have a lot of form ids in the $gin_lb_form_ids variable, e.g. entity browser ids, media edit forms (if you use that module, ...)
This code will ensure all those forms use the actual gin css.// Get active theme $theme = \Drupal::theme()->getActiveTheme()->getName(); if ($theme != 'gin') { // Enable gin_lb theming for custom frontent forms too. $gin_lb_form_ids = [ 'override_entity_form', ]; if (in_array($form_id, $gin_lb_form_ids)) { $form['#after_build'][] = [ 'Drupal\gin_lb\HookHandler\FormAlter', 'afterBuildAttachGinLbForm', ]; $form['#gin_lb_form'] = TRUE; $form['#attributes']['class'][] = 'glb-form'; unset($form["revision_information"]); unset($form["revision_log_message"]); unset($form["revision"]); unset($form["revision_log"]); } }
- πΊπΈUnited States jnicola
We've got this issue. Been faffing with the code above, doesn't seem to work. Also doesn't really capture folks using gin as a base theme? Also just not sure about that first conditional of if the theme IS NOT gin? Without comments or a link to another issue I'm guessing at exactly what it's trying to resolve.
Here's our modified version that checks if it is GIN or a GIN sub theme, but for us isn't working. Even skipping the initial theme check (where you went != and I went == or in array) it does not seem to resolve the issue.
// ATTEMPT TO FIX GIN LB OVERRIDE ENTITY FORM MISSING SUBMIT BUTTON! $theme = \Drupal::theme()->getActiveTheme()->getName(); $base_themes = array_keys(\Drupal::theme()->getActiveTheme()->getBaseThemeExtensions()); if ( $theme == 'gin' || in_array('gin', $base_themes) ) { // Enable gin_lb theming for custom frontend! forms too. $gin_lb_form_ids = [ 'override_entity_form', ]; if (in_array($form_id, $gin_lb_form_ids)) { $form['#after_build'][] = [ 'Drupal\gin_lb\HookHandler\FormAlter', 'afterBuildAttachGinLbForm', ]; $form['#gin_lb_form'] = TRUE; $form['#attributes']['class'][] = 'glb-form'; unset($form["revision_information"]); unset($form["revision_log_message"]); unset($form["revision"]); unset($form["revision_log"]); } }
- πΊπ¦Ukraine Foxy-vikvik
I am working on a project where we use Gin + Paragraphs, and your code does not work for me.
- π§πͺBelgium StryKaizer Belgium
@jnicola
Also just not sure about that first conditional of if the theme IS NOT gin?
As said, my code is a fix for users using layout builder (which is rendered in frontend theme).
If you experience this issue in the backend, my code snippet will not help you ;)
- π©πͺGermany a.dmitriiev
For me updating to Gin 3.0.0-rc14 fixed the problem. The "Save" button appeared at the bottom of the modal window.
- πΊπΈUnited States jnicola
Double check that the save button is there and that it actually saves. Our problem is that we can get the Save button back using a related patch for Gin, but unfortunately the submission does not succeed with no ajax error nor drupal log error.