Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Needs work
over 1 year ago 1:09pm 9 March 2023 - 🇵🇹Portugal marcofernandes
There should be a condition to check if there are custom settings.
---> foreach ($custom_settings['categories'] as $category) { $category['reference'] = str_replace('/', '-', $category['reference']); $form['gutenberg']['categories']['#default_value'][] = $category['reference'];
- 🇵🇹Portugal marcofernandes
Adding patch for 8.x-2.x-dev (works with 8.x-2.7).
- Status changed to Needs review
over 1 year ago 1:18pm 9 March 2023 -
marcofernandes →
committed a91193bc on 8.x-2.x
Issue #3328033 by marcofernandes, foadyousefi, perandre: Add condition
-
marcofernandes →
committed a91193bc on 8.x-2.x
- last update
over 1 year ago Build Successful - Open on Drupal.org →Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - 🇮🇳India KalaiyarasiThangavel
Hi,
I have added a new patch here..This works for me. Kindly review it.
- 🇺🇸United States alison
I tried applying the changes in commit #a91193b to my site, running Gutenberg 2.7.0, and the patch applied fine, but I don't have any checkboxes for my custom Gutenberg blocks on the content type settings form.
(Is it still in-progress, that's all, or?)
Thank you!
- Status changed to Fixed
about 1 year ago 10:30pm 16 October 2023 - 🇵🇹Portugal marcofernandes
Already working on dev and released on 2.8. Closing.
- Status changed to Needs review
about 1 year ago 8:48am 27 October 2023 - 🇳🇴Norway vegardjo
Hi guys, as with Alison I'm not quite getting this. I have upgraded on an existing site + a vanilla d10, and I have no UI for custom modules. On my vanilla I have installed this custom block which I would expect to find in the UI:
const settings = { title: __('Factbox'), description: __('Block with title and content that can be aligned'), icon: 'info-outline', attributes: { title: { type: 'string', }, alignment: { type: 'string', default: 'full' } }, edit({ attributes, setAttributes }) { ... } save({ attributes, setAttributes }) { ... } } const category = { slug: 'text', title: __('Text'), }; registerBlockType(`${category.slug}/gb-factbox`, { category: category.slug, ...settings });
- Status changed to Needs work
about 1 year ago 9:46am 2 November 2023 - 🇵🇹Portugal marcofernandes
We need documentation for this 😅
Currently we don't have "auto-discovery" for custom blocks so in order to be able to manage custom blocks availability, at
[theme].gutenberg.yml
settings file, you need to add thecustom-blocks
section, for example:custom-blocks: categories: - reference: text name: Text blocks: - id: text/gb-factbox name: Factbox - reference: media name: Media blocks: - id: media/some-custom-media-block name: My Media
Note about blocks auto-discovery: This needs to be done at server level and the idea is to use a json (or yaml) file to define block's metadata like WordPress does.
Leaving this open (Needs work) until we get documentation.
-
marcofernandes →
committed a91193bc on 3.0.x
Issue #3328033 by marcofernandes, foadyousefi, perandre: Add condition
-
marcofernandes →
committed a91193bc on 3.0.x
- 🇳🇴Norway vegardjo
I updated the documentation for this at https://www.drupal.org/docs/contributed-modules/gutenberg/gutenberg-bloc... →
I also updated the title, but the navigation link in the sidebar to it needs to be updated accordingly, and seems a documentation maintainer would have to do that.
However, adding this also results in a php warning per custom block you add, at /admin/structure/types/manage/[bundle], so I believe this should also be fixed before we can close this.
Warning: Undefined array key "default" in {closure}() (line 303 of modules/contrib/gutenberg/gutenberg.module). {closure}(Array) array_map(Object, Array) (Line: 305) gutenberg_form_alter(Array, Object, 'node_type_edit_form') (Line: 545) Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'node_type_edit_form') (Line: 840) Drupal\Core\Form\FormBuilder->prepareForm('node_type_edit_form', Array, Object) (Line: 284) Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73) Drupal\Core\Controller\FormController->getContentResult(Object, Object) call_user_func_array(Array, Array) (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 592) Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Merge request !100Issue 3328033: Load custom blocks configuration from modules too. → (Merged) created by marcofernandes
-
marcofernandes →
committed 8c980044 on 8.x-2.x
Issue #3328033: Add check
-
marcofernandes →
committed 8c980044 on 8.x-2.x