Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This button is part of the block type add form. It's supposed to be available only for edit form. This is a bug introduced in 613a302e0f8b88fb26c4e25cf38be55b8a1abbe1
Nowadays it seems a leftover, since block types are remove now from the overview page.
Comment | File | Size | Author |
---|---|---|---|
#7 | bean-1710256.patch | 1.65 KB | jonhattan |
#2 | bean-1710256-2.patch | 802 bytes | indytechcook |
#1 | bean-1710256.patch | 707 bytes | jonhattan |
Comments
Comment #1
jonhattanComment #2
indytechcook CreditAttribution: indytechcook commentedSo there is a bug with the delete button showing. It should show on the edit form. Here is a patch. Please test.
Comment #3
FiNeX CreditAttribution: FiNeX commentedThe last patch doesn't work on the current -dev release: the delete button is not shown.
Even after creating the bean block type,
$form['new']
is an array with the#value
always "TRUE".Moreover, if you skip the if included in the patch, the delete button is visible but it throws two errors:
And the redirected page (admin/structure/block-types/manage//delete) is not found.
Comment #4
indytechcook CreditAttribution: indytechcook commentedThanks for the quick test. I'll work on it some more.
Comment #5
betz CreditAttribution: betz commentedIt looks reverse now. The delete button shows on the 'add form', but not on the 'edit form'.
Comment #6
jonhattanIf the bean is exported to code, $form['new'] is always true, because of:
Comment #7
jonhattanA fix is attached:
* don't show the button on creating a bean_type
* don't show the button if the bean is exported to code and not overridden
* show otherwise: if it's not exported to code or if it's in code and overridden (in this case the button label changes to 'revert')
Comment #8
jonhattanAdjust issue tag
Comment #9
indytechcook CreditAttribution: indytechcook commentedThanks jonhattan. I echoed one comment from #1785950: Revert and delete should be separate operations. THanks for the issue tag also.
We can't assume getExportStatus() exists.
May I ask why this change was necessary?
Comment #10
indytechcook CreditAttribution: indytechcook commentedThanks http://drupal.org/commitlog/commit/22232/2f4075ef5d6b3ccc6a30259fcc7aad5...
Comment #11
jonhattanSorry for the delay in my response, I've been relocatring to another city.
On your second question in #9. I think I did this just because the object is primarily assigned to $form['bean_type'] but can't remember details now. Once I test the new code will open new issues if neccesary.
Note that you introduced a patch file in the root directory with this commit: bean-1786036.patch
Comment #12
jonhattanCreated a new issue for that #1814068: Remove leftover patch files in repo