Setting equal weight to Management and Navigation blocks does not sort them alphabeticaly within a region although admin-structure-block table shows their order correctly.

CommentFileSizeAuthor
#4 901658-4.patch536 bytesygerasimov
#2 901658-2.patch539 bytesygerasimov

Comments

ygerasimov’s picture

I confirm this bug. In order to reproduce disable javascript and manually set same weights for the blocks.

ygerasimov’s picture

Status: Active » Needs review
StatusFileSize
new539 bytes

On admin page blocks are sorted by title (see function _block_compare()), but on display they are ordered by name of the module (see function _block_load_blocks()). I am not sure what should be the right order?

It is easier to sort blocks admin list by module to make them same order with display. Will it do the job?

Status: Needs review » Needs work

The last submitted patch, 901658-2.patch, failed testing.

ygerasimov’s picture

Status: Needs work » Needs review
StatusFileSize
new536 bytes

resubmitting patch

mertskeli’s picture

Doesn't work for me.

ygerasimov’s picture

I have rechecked and it does work. In order to reproduce:
1. Create node, add link to Navigation menu.
2. Disable javascript
3. Go to blocks page set same weights for Navigation and Management blocks.

Ensure that both on block administration and home page Navigation block is upper than Management.

@mertskeli please confirm whether this patch work or not for you?

mertskeli’s picture

No. Unfortunately it does not work in my case.
I guess the problem is in Management block. It has some explicit weight somewhere, I suppose. By default it is "1", not "0". Setting it to "0" does not change the order. The order changes only if I set different weights.
Tried both options: JS on/off - no difference. But I guess it is supposed to work with js. (Although I'm not going to use it myself, table*.js are buggy and selfassign weights.)
Why to create a node? For example, I have "Polls" there. It is not a node, but still a link.

ygerasimov’s picture

You are completely right. There is no difference what kind of link to have in Navigation menu.

With javascript disabled you can set the weights of blocks manually.

mertskeli’s picture

With javascript disabled you can set the weights of blocks manually.

Sure. If the alphabet is not alphabetical there is no other way than weights :)

ygerasimov’s picture

I think there is misunderstanding here. Initial problem was that if we set blocks the same weight, they are displayed differently on blocks admin page and in region on the site. That was happening because on the admin page blocks were sorted by title and in region they are sorted by name of module. With the patch #4 blocks on admin page are sorted by the name of the module that is completely the same as in region.

@mertskeli. Please advise whether this way will fix the problem of different display? Do I understand the problem correctly?

mertskeli’s picture

Yes, you you understand the problem correctly.
But shift to 'module' as per #4 patch does not solve the problem - Management block is not sorted by alphabet (in a region).

ygerasimov’s picture

Status: Needs review » Needs work

I don't see technical possibility to order region blocks by alphabet. All the code is scanned for the blocks during the _block_rehash() and system does not keep track of titles of the blocks. I think we need input of some other developers about this issue or keep sorting by name of module on admin page.

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.