See the attached screenshot. To reproduce, go to admin/structure/block/list/seven and click the "Add block" link from there.

It's due to this code in block_help(), combined with the patch that went in at #556872: Action links do not work on all levels (example: 'add block' action link does not appear):

  if ($arg[0] == 'admin' && $arg[1] == 'structure' && $arg['2'] == 'block' && (empty($arg[3]) || $arg[3] == 'list')) {
    // (The help text intended for admin/structure/block and admin/structure/block/list/[theme-name] is output here.)
  }

Ideally, we'd much rather replace this ugly code with something like the following:

    case 'admin/structure/block':
    case 'admin/structure/block/list/%':

But that won't work as is since the block module's menu items aren't being created via menu wildcards but rather via a custom foreach() loop. (Would love to see that part fixed somehow...)

Comments

David_Rothstein’s picture

StatusFileSize
new58.13 KB

Screenshot didn't get attached for some reason.

David_Rothstein’s picture

Status: Active » Needs review
StatusFileSize
new2.06 KB

Assuming we don't want to try for a nicer fix, something horrible like the attached should get the job done.

andypost’s picture

+1 to rtbc

is help needed for block add and not for edit? Maybe we unify this

retester2010’s picture

#2: fix-add-block-help-743590-2.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, fix-add-block-help-743590-2.patch, failed testing.

andypost’s picture

Status: Needs work » Needs review
Issue tags: +Quick fix
StatusFileSize
new2.78 KB

re-roll against current HEAD, added test, taggin' and suppose RTBC

Issue reproduced only when more then 1 theme enabled and "Add block" link clicked on none-default theme.

reglogge’s picture

StatusFileSize
new2.86 KB

This works.

Reroll against current HEAD and fixing indentation issue here:

+  if ($arg[0] == 'admin' && $arg[1] == 'structure' && $arg[2] == 'block' && ($arg[3] == 'add' || ($arg[3] == 'list' && $arg[5] == 'add'))) {
       return '<p>' . t('Use this page to create a new custom block.') . '</p>';
   }
-  if ($arg[0] == 'admin' && $arg[1] == 'structure' && $arg['2'] == 'block' && (empty($arg[3]) || $arg[3] == 'list')) {
+  if ($arg[0] == 'admin' && $arg[1] == 'structure' && $arg[2] == 'block' && (empty($arg[3]) || ($arg[3] == 'list' && empty($arg[5])))) {
David_Rothstein’s picture

The tests don't look quite right to me because they assert the presence of a translated *partial* string (not the whole string that actually appears in the module). This translation won't actually exist. Does that mean the tests could fail when run on a non-English site? (I'm not sure.)

I wonder if we need tests at all here? I guess it doesn't hurt, but this is the sort of thing that is hard to test cleanly, and since we don't reorganize URLs that often (certainly not likely to happen again in the Drupal 7 cycle) it's also not the sort of thing that can break easily. I bet we could just rely on humans to catch this kind of thing.

thedavidmeister’s picture

Version: 7.x-dev » 8.0.x-dev
Issue summary: View changes
Status: Needs review » Needs work

I *think* this is not an issue in d8 due to the routing system doing stuff, *but* if we're doing tests (which should work fine, the testbots should run in English unless part of the test changes the language, I believe) then the tests will need to happen in d8 and then the fix ported to d7.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

quietone’s picture

Version: 8.9.x-dev » 7.x-dev

Tested on 8.9.x and 9.2.x and this is not a problem when adding a custom block or placing one.

So moving to Drupal 7.

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.