Problem/Motivation
The action link 'Add custom block' on the Block layout page takes the user to empty page when there are no custom block types available, for example when using the minimal install profile.
Proposed resolution
When no custom block types are available, present an 'empty text' with a link to the block creation page.
Remaining tasks
Write a patchReview
User interface changes
The page on /block/add shows an empty text and link to the custom block type creation page when no custom block types are available.
API changes
None
Original report by @sachbearbeiter
Referring to https://www.drupal.org/node/2350265
We both have the problem, that in our D8 installations "Add Custom Block" functionality is not working like desired.
The page http://foo.com/block/add is loaded empty.
Comparing with another test page (where it is working properly):
The log of the non working installation is listing really often:
Type filter
Message Missing filter plugin: filter_null.
Severity Alert
+ i did a minimal install here initially ...
does somebody has an idea?
regards sb
Beta phase evaluation
Issue category | Task because it does not resolve any bugs or add any new features |
---|---|
Issue priority | Normal because it does not affect any major systems |
Unfrozen changes | Unfrozen because it only changes markup |
Prioritized changes | The main goal of this issue is usability. |
Disruption | Not disruptive |
Comment | File | Size | Author |
---|---|---|---|
#28 | 2403105-28.patch | 5.9 KB | idebr |
#28 | 2403105-28-after.png | 67.38 KB | idebr |
#28 | 2403105-28.fail_.patch | 4.74 KB | idebr |
#26 | block-add.23.patch | 5.9 KB | larowlan |
#26 | interdiff.txt | 599 bytes | larowlan |
Comments
Comment #1
sachbearbeiter CreditAttribution: sachbearbeiter commentedComment #2
dawehnerThe problem is that you don't have any custom block types configured by default, see admin/structure/block/block-content/types
Afaik we should, similarily to the node types page (node/add) tell the user in case there are none defined.
Comment #3
sachbearbeiter CreditAttribution: sachbearbeiter commentedahh - i see - stupid by me - sorry ...
please feel free to close or to modify the title and issue metadata as a task ...
thanks a lot for the fast reply
Comment #4
dawehner@sachbearbeiter
Well I think you could provide such a fix for the block/add page ... having some short help text there is useful, no question.
Comment #5
larowlanComment #6
mshaver CreditAttribution: mshaver commentedHere is a patch to add the text to the twig file. I'll open an issue to have this added to seven as well.
Comment #7
larowlanPlease do it here too, no need for two issues
Comment #8
larowlanHi, the fix belongs in the controller, themes should need to worry about this kind of logic.
New patch, no interdiff - new approach.
Comment #11
larowlanComment #12
larowlansome things berdir pointed out
Comment #13
BerdirInstead of initial, I'm wondering if "default" or "basic" (because that is how the block type is named) would be a better name.
Also, note that drupalCreateContentType() creates the body field by default, wondering if we'd want that here as well, then we would not even need the helper method?
As discussed, the standard profile reference seems not helpful to me, I don't know what that is trying to say me.
I'm not sure anymore when we should use t() exactly and when not. Usually, I think we still use it when testing strings that were passed through t(), but it doesn't really matter as it's not the same string anyway.
Comment #14
webchickComment #15
larowlanFixes #13
Comment #17
larowlanreroll
Comment #19
larowlanNot sure what I'm doing wrong here
Comment #21
larowlanneclimdul+1000
Comment #24
larowlandoh
Comment #26
larowlandoh^2
Comment #28
idebr CreditAttribution: idebr commentedThanks @larowlan, I did a manual test to confirm the message is displayed when no custom block types are available.
I have split the patch with a tests-only edition; the patch file has no changes compared to #25.
Annotated screenshot to show the new behavior:
Comment #29
idebr CreditAttribution: idebr commentedI updated the issue summary to reflect the changes in the patch and included a beta evaluation.
Comment #31
alexpottCommitted 834c5a2 and pushed to 8.0.x. Thanks!
Thank you for adding the beta evaluation to the issue summary.