- Issue created by @alexahumada
- 🇪🇸Spain alexahumada
Quick patch reverting changes in 10620a91 in case somebody needs it before we find a better solution.
- Status changed to Needs work
over 1 year ago 7:45pm 29 March 2023 - 🇪🇸Spain alexahumada
Can't be reproduced on a fresh install, you need at least one extra language set to default (in my case ES set as default language and EN as secondary).
- @alexahumada opened merge request.
- Status changed to Needs review
over 1 year ago 2:51pm 4 April 2023 - Status changed to RTBC
over 1 year ago 3:08pm 4 April 2023 - 🇮🇳India rckstr_rohan
reviewed the MR, looks good and optimised, didn't find any issue while adding new block to a category leads.
-
vbouchet →
committed c6040f2f on 8.x-1.x authored by
alexahumada →
Issue #3351162 by alexahumada: Undefined array key "" in Drupal\...
-
vbouchet →
committed c6040f2f on 8.x-1.x authored by
alexahumada →
- Status changed to Fixed
over 1 year ago 2:38pm 6 April 2023 - 🇫🇷France vbouchet
Thanks @alexahumada for reporting, providing a temporary workaround and a patch. I also tested it with the success and pushed to 1.x branch. It will be part of the next release.
- Status changed to Needs work
over 1 year ago 3:17pm 6 April 2023 - 🇫🇷France vbouchet
Reopening it as I realised that using this will make most of the inline field blocks part of "@entity fields" category (basically it merges comment, node, user, ... inline field in a unique dropdown). In my case, the category label is "Webform submission fields" probably because it is alphabetically ordered. I am reverting for now.
-
vbouchet →
committed f50c6c67 on 8.x-1.x
Revert "Issue #3351162 by alexahumada: Undefined array key "" in Drupal\...
-
vbouchet →
committed f50c6c67 on 8.x-1.x
- 🇫🇷France vbouchet
@alexhumada, I just merged the patch from https://www.drupal.org/project/layout_builder_browser/issues/3342348 🐛 Fails show the form of adding block to a category PHP TypeError Fixed .
Warning: Undefined array key "" in Drupal\layout_builder_browser\Form\BlockForm->form() (line 101 /var/www/html/web/modules/contrib/layout_builder_browser/src/Form/BlockForm.php).
The line 101 is
'#options' => $blocks[$provider],
The patch from #3342348 is fixing an issue on $provider so I am wondering if it is still an issue?
- 🇪🇸Spain alexahumada
Hi @vbouchet, these are two unrelated issues, as @robert-arias pointed 🐛 Fails show the form of adding block to a category PHP TypeError Fixed .
- 🇪🇸Spain alexahumada
Also, I should clarify code from the patch in #3 and in MR15 is not the same.
The patch just reverted changes from commit 10620a91 and was supposed to be a temporary fix and the MR is my proposed solution. - 🇫🇷France vbouchet
@alexahumada I am not able to reproduce the issue mentioned here. I enabled a second language and make it default. I still can place a block in a category without any issue (or even warning in logs). Do you have more information on the steps to reproduce?
I applied the code from MR15 (see https://git.drupalcode.org/project/layout_builder_browser/-/commit/c6040...) but after I applied, all the field blocks are merged into a unique provider because the category id given by getUntranslatedString() is "@entity fields" whereas it is "comment fields" or "user fields" when we use render().
The error you report (undefined array key "") seems fixed with the patch provided in the other issue: https://www.drupal.org/files/issues/2023-04-01/layout_builder_browser-ph... →
- 🇪🇸Spain alexahumada
I checked again on a clean install. Yes, it seems that MR15 solved my problem but introduces that another issue. Patch from 3342348 also solves this issue, sorry about the confusion. We should mark this as solved.
- Status changed to Fixed
over 1 year ago 7:10pm 6 April 2023 - Status changed to Closed: duplicate
over 1 year ago 7:11pm 6 April 2023 - 🇪🇸Spain alexahumada
I'm closing is as a duplicate, as I shouldn't get credit from a MR that was not merged and was solved in another issue.
Thanks for your review @vbouchet! - 🇫🇷France vbouchet
Thanks @alexahumada for taking the time of checking and closing the issue.