Follow-up to: #1871772: Convert custom blocks to content entities

Problem

  • custom* module names are the informal standard namespace for custom developed, site-specific modules.
  • I have at least a dozen of sites that have a custom_block.module already (among other custom* modules).

Proposed solution

  1. Rename custom_block.module to block_custom.module.
  2. Move the module directly into /core/modules/
  3. Add a block_custom.module component for issues to d.o.
Files: 
CommentFileSizeAuthor
#36 Renamed-custom_block-to-block_content-1920862-36.patch0 bytesxan.ps
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 66,335 pass(es).
[ View ]
#22 custom-block-rename.22.patch98.21 KBlarowlan
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch custom-block-rename.22.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#37 Renamed-custom_block-to-block_content-1920862-37.patch258.21 KBxan.ps
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 65,020 pass(es), 10 fail(s), and 3 exception(s).
[ View ]
#15 custom-block-1920862-15.patch91.64 KBtim.plunkett
FAILED: [[SimpleTest]]: [MySQL] 51,257 pass(es), 33 fail(s), and 4,834 exception(s).
[ View ]
#10 custom-block-block-custom.patch83.72 KBtim.plunkett
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.
[ View ]

Comments

Title:Rename custom_block.module to block_clustom.moduleRename custom_block.module to block_custom.module

The module should also be moved directly into /core/modules/. Updated the issue summary accordingly.

+1 for this change.

+1 here, this overlaps with a lot of custom modules done for specific sites.

Status:Active» Postponed

Oh god this just completely bit me for several hours. Adding a custom module completely hoses your Drupal 8 site the moment you enable it: #1929720: How the bleepity bleep do you debug missing use statements in classes? because custom_block_load() then becomes a hook_block_load() implementation with block entity objects being passed into it rather than entity IDs like it expects. And core *should* have failed gracefully if you pass in non-numeric entity IDs, except it doesn't. It explodes into a firey death from which you cannot recover due to #1003788: PDOException:Invalid text representation when attempting to load an entity with a string or non-scalar ID.

A death of a thousand suns should be administered to custom_block namespace.

I'd like to suggest we rename this block_content instead of block_custom. Any issues with that?

Eclipse

Status:Postponed» Active

Perhaps it's bikeshed time, even? :)

I actually wonder whether we couldn't find a name that doesn't have "block" in it… That is, because all of the function names and class names (à la CustomBlockBlock or custom_block_block_view_alter() :P) are a little bit confusing.

We apparently had a very nice and short name for certain blocks in D6 and below: Boxes.

box.module?

I really had some hate with block_box_get()... Very inconsistent naming and once an object and once an array and sometimes a different array structure... :-(

StatusFileSize
new83.72 KB
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.
[ View ]

Status:Active» Needs review

Status:Needs review» Needs work

The last submitted patch, custom-block-block-custom.patch, failed testing.

<paint target="bikeshed">how about content_block?</paint>

The last submitted patch, custom-block-block-custom.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new91.64 KB
FAILED: [[SimpleTest]]: [MySQL] 51,257 pass(es), 33 fail(s), and 4,834 exception(s).
[ View ]

Whoops, forgot the rename bit.

The good thing is, as long as the patch applies, picking a new name is easy, since you can just edit the patch file directly.

Status:Needs review» Needs work

The last submitted patch, custom-block-1920862-15.patch, failed testing.

Assigned:Unassigned» larowlan

I'll kick this along later today, I was expecting the upgrade path to fail, thats why we were waiting on #1919910: Refactor custom_block upgrade path to create tables using hook_schema_0() instead of in block_update_N() - the rest looks straight forwardish

Not content_block, because this would result in the same problem when a content.module exists and is enabled on the site.

Right, I still really like block_content.module. I think it actually says what it is, and solves the other problems that lead to this issue.

Eclipse

block_content works for me

+1 for block_content

Status:Needs work» Needs review
StatusFileSize
new98.21 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch custom-block-rename.22.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

So this uses block_content.
Upgrade path should pass this time because block_content != existing {block_custom} table in D7.
So change to any other name should be straight forward, using block_custom will require new upgrade path that adds fields to the existing table.

Note module is still called 'Custom Block' and so are entities, I don't think 'Block Content' fits in that regards. I still like 'Add custom block' better than 'Add block content'.

Status:Needs review» Needs work
Issue tags:-API clean-up

The last submitted patch, custom-block-rename.22.patch, failed testing.

Status:Needs work» Needs review
Issue tags:+API clean-up

#22: custom-block-rename.22.patch queued for re-testing.

green :)
We just need to agree on whether we change the entity names, module name etc too

@larowlan please use -M25% to minimize a patch size
I think classes and other parts should be renamed too

Issue tags:-API clean-up

#22: custom-block-rename.22.patch queued for re-testing.

Status:Needs review» Needs work
Issue tags:+API clean-up

The last submitted patch, custom-block-rename.22.patch, failed testing.

Title:Rename custom_block.module to block_custom.moduleRename custom_block.module to block_content.module

I had entered a duplicate here #2027101: Remove the word "custom" from block module UI elements. There are nice images and descriptions in the dupe.

Component:block.module» custom_block.module

Ironic, but yeah.

Issue summary:View changes

Updated issue summary.

Issue summary:View changes
Issue tags:+beta target, +rename module

Issue tags:+Needs reroll

In particular this rename/move still is highly important due to the inofficial but common "custom" module name clashes. I'm tempted to bump this to critical.

Do we have an idea of when a good time-frame for this rename (and others) might be?

Perhaps the same time-frame when we're going to switch to PSR-4?

I don't see any reason why this couldn't land whenever it's RTBC. There are no other beta blocker or beta target issues for custom_block.module, so I doubt committing this will create much reroll pain for other issues.

StatusFileSize
new0 bytes
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 66,335 pass(es).
[ View ]

StatusFileSize
new258.21 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 65,020 pass(es), 10 fail(s), and 3 exception(s).
[ View ]

Apologies. By mistake there was some issue while uploading the patch.
The new patch file has been attached.

Status:Needs work» Needs review

The last submitted patch, 37: Renamed-custom_block-to-block_content-1920862-37.patch, failed testing.