Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
block.module
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 Jun 2009 at 09:27 UTC
Updated:
3 Jan 2014 at 00:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
skilip commentedNote this patch depends on the functionality requested here: #503816: Make form elements expandable.
Comment #2
skilip commentedComment #4
skilip commentedOk, removed the expandable functionality which was an obvious no-go
Comment #5
attiks commentedAlso posted at #503908: Assign a new block to a region on add block page
If you create a block at admin/build/block/add, which regions will be displayed? The one from the default theme, the current theme or the admin theme?
Isn't is possible to move the add block link to a particular theme so you'll which regions to display?
NVM: i just had a look at the patch and it displays a select for each theme
Comment #7
andypostbot was broken - retest
Comment #9
webchickOh, testing slave #26... you're "special."
Comment #10
dries commented1. Just wondering, haven't looked at the code yet, but in case we are creating a new block, should we do an insert instead of an update?
2. It is not clear why we save the region both in the _validate and the _submit handler. Care to explain why that is necessary?
Comment #11
skilip commentedCleaned up the patch and actually managed to use db_merge.
Comment #12
dries commentedI applied this patch and played around with it a bit. I found it slightly odd that the main block administration page is for the enabled themes, but that the new per-block configuration also considers themes that are not enabled. In 80% of the cases (including a default core install), only 1 theme is enabled so it is somewhat odd that you're presented with themes you might not have seen yet. Any thoughts on that?
Comment #13
skilip commentedI agree it's a bit confusing. If we'd use an 'expandable' selection list (functionality proposed here: #503816: Make form elements expandable) for the non-theme-default themes, it might be less confusing. Here's an example
Comment #14
skilip commentedAdded an if statement to exlude disabled themes
Comment #15
skilip commentedA few minor changes after recommendations from ultimateboy.
Changed the fieldset title to 'Region settings' and it now uses the theme info name instead of the theme key.
Comment #17
yoroy commenteddouble check…
Comment #18
sign commentedRerolled #15, works ok for me
Comment #19
skilip commentedCan we mark this RTBC?
Comment #20
dries commentedCommitted this to CVS HEAD after I fixed the code comments. Thanks.
Comment #21
yoroy commentedNice one!
Comment #22
davyvdb commentedThis didn't work on adding a new block. Only on update. This small patch fixes this.
Comment #23
davyvdb commentedComment #25
davyvdb commentedComment #26
David_Rothstein commentedAwesome patch - I've been thinking that something like this is needed, especially in light of the work on #473268: D7UX: Put edit links on everything which would link a lot of users directly to the individual block configuration pages.
In addition to the followup already posted here, there are other issues with the original patch that should be fixed:
1. Using system_get_theme_data() causes a filesystem scan, which is unnecessary; I'm pretty sure list_themes() is a better choice.
2. The patch does not properly deal with hidden theme regions (in particular, it lets you assign blocks to them). It needs to make use of system_region_list(), as is done on the other block administration page; see block_admin_display_form().
3. The help text on the add blocks page needs to be updated, since it currently says: "New blocks are disabled by default, and must be moved to a region on the blocks administration page to be visible."
4. We should think about changing the user interface here a bit; in my opinion, this setting is too important to hide away in a collapsed fieldset like the others.
I'd reroll the patch myself, but all these issues are bugs/UI improvements, so they can be dealt with after code freeze, and I really don't want to spend the time tracking down the test failures now :)
Comment #27
David_Rothstein commentedDid not mean to reset status just yet - let's see if the test failures are real after all.
Comment #28
davyvdb commentedThis patch also uses list_themes. This is conform with the creation of the local task on admin/structure/block in hook_menu.
Comment #29
mgifford+1
Applied this against core and it worked just fine.
Comment #30
davyvdb commentedComment #31
dries commentedCommitted to CVS HEAD. We still need tests though, so marking this 'code needs work'.
Comment #32
David_Rothstein commentedAlso still needs work for the issues I described in #26.
Comment #33
davyvdb commented@David_Rothstein I'm using list_themes in my latest patch. This is the same function used in hook_menu. So if we changed it in one place, we should match the other one. Maybe open a new issue for this?
Comment #34
David_Rothstein commentedRight, my first point in #26 was fixed in the latest patch, but points 2-4 were not. However, we can deal with that post code freeze.... somewhere... although I think this issue is a good place, so as to consolidate all the followups in one location :)
Comment #35
davyvdb commentedthe following patch should at least fix the issue where hidden regions should not be displayed in the select block. It also fixes the help message.
Comment #36
ugerhard commentedComment #37
davyvdb commented@David_Rothstein Regarding interface. I think this might help too #556390: Vertical Tabs on block visibility settings
Comment #39
davyvdb commentedHEAD is broken
Comment #40
gábor hojtsyThere is also a bug with this noted by Jacob Singh: that -1 is saved as the region for disabled blocks and then comes back with "The block {title} was assigned to the invalid region -1 and has been disabled." Not nice :| Reported at http://drupal.org/node/544360#comment-2127370
Looks like those tests mentioned by Dries are indeed lacking.
Comment #41
gábor hojtsy@webchick noted the same -1 issue on http://drupal.org/node/517688#comment-2170538 while testing overlays.
Comment #42
gábor hojtsySubmitted separate issue for the new block problem at #648710: Error when creating new block: The block %info was assigned to the invalid region %region and has been disabled., so this can concentrate on the existing issue with visible regions.
Comment #45
mr.baileysMarked #716388: Custom user added blocks can be added to non-existent regions as a duplicate of this one.
Comment #46
Everett Zufelt commentedMarking critical. As I point out in #716388: Custom user added blocks can be added to non-existent regions (marked as duplicate), users can add a block to a region that is not visible on the block manage page. This means that a user can add a block, it will appear on the site, but the user will not be able to access the block to modify / remove it. To me it is critical if a user can add content to their site, but cannot remove it again.
Comment #47
eojthebraveThis should fix the issue with hidden regions showing up on the block add/configure page. Switched the options list to use
system_regions_list().This patch also fixes the help text on the page.
I've attempted to write tests for this but am running in to some problems. I believe that that test in the attached patch should pass, however
system_regions_list()seems to act funny in the context of a test. The hidden regions are still being displayed in the select list during a test run. Though I've confirmed that they are not there when visiting the page normally.Marking as needs to review so that the tests get run to confirm the failures.
Anyone have any insight?
Comment #49
eojthebraveHmm. Not exactly what I expected. Lets try this one.
Comment #50
eojthebravebot.
Comment #51
dries commentedCommitted to CVS HEAD. Thanks.