Postponed (maintainer needs more info)
Project:
Drupal core
Version:
main
Component:
block.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
27 Dec 2012 at 12:47 UTC
Updated:
15 Sep 2025 at 16:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
xjmComment #2
xjmComment #3
xjmComment #4
mojzis commented3 first bullets for review
this will apply after http://drupal.org/node/1874598#comment-7156136
Comment #6
xjm#4: drupal-multiple-1874822-4.patch queued for re-testing.
Comment #8
xjm@mojzis, I haven't tried to debug the failures, but one quick note is that you need to configure your text editor to show or remove trailing whitespace. The patch is full of it. :)
Comment #9
star-szr#4: drupal-multiple-1874822-4.patch queued for re-testing.
Comment #11
littlecodingRemoved trailing whitespace.
Comment #12
littlecodingComment #14
lbainbridge commentedThe patch above tried to urlencode a variable that was later urlencoded by drupal, causing a failure. However we still managed to expose a bug, that being that the user menu block cannot be placed twice on a page. This patch should fail testing because of this, here are the steps to reproduce:
Comment #15
lbainbridge commentedEscalated to major because things are broken by the way.
Comment #17
saltednutI believe the error described in #14 is related to #1998664: An existing block instance will be overwritten by a newly created block instance if the two share the same machine_name
Comment #18
star-szrWorking on updating these tests. Tentatively changing priority to normal because I believe the reported bug (#14) has long since been fixed, we're just adding additional test coverage and I don't think any other issue has added this missing coverage.
Comment #19
star-szrI don't think we need to re-test the whole block UI for this, so I decided to use #1872540: Provide a test helper method for creating block instances and with that this got SO much easier. xjm++
@porchlight and I worked on this during sprint weekend.
No interdiff since this changes almost everything, and also adds a test for placing multiple instances of the same custom block, covering everything in the issue summary. I created \Drupal\custom_block\Tests\CustomBlockInstanceTest for that. Arguably the test added to \Drupal\block\Tests\BlockTest that uses views could be moved to the views namespace, I could go either way on that.
Comment #20
star-szrAdding proposed commit message to the issue summary.
Comment #21
star-szrAdding related issue that spun off from working on this.
Comment #23
star-szr19: 1874822-19.patch queued for re-testing.
Comment #24
joelpittetI reviewed this patch line by line and tested the tests in the UI. IMO it works and does exactly what it intends to do on the tin.
Nice work, y'all
Comment #25
star-szrThanks @joelpittet! FWIW this patch can be cleaned up a bit/improved if #2181855: Don't let ViewTestBase hog the useful assertBlockAppears and assertNoBlockAppears methods is committed first and I'd be happy to make those updates.
Comment #26
webchickThat did indeed make it in!
Comment #27
star-szrThanks :)
Comment #28
star-szrNow making use of assertBlockAppears.
Comment #30
star-szr28: 1874822-28.patch queued for re-testing.
Comment #31
star-szrComment #32
jhedstromComment #33
star-szrWorking on it.
Comment #34
star-szrMost notable change here is in WebTestBase::findBlockInstance():
Changed the XPath from
//div[@id = :id]to//*[@id = :id], not all blocks use DIVs - like menu blocks.Other than that just updating for PSR-4 and some other things, and splitting the multiple instance tests out of the catch-all BlockTest. I can't figure out why testPlaceBlockTwiceVarious isn't passing, manually testing that block works fine but posting this work in progress since I need to run :)
Comment #35
star-szrRemoving an unnecessary hunk.
Comment #40
tim.plunkettNot actively part of the Blocks-Layouts work.
Comment #42
joelpittetRerolling
Comment #56
smustgrave commentedThank you for creating this issue to improve Drupal.
We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!