Hi there,

As the title said, the Block defaults are not working. I have created a role and assigned this role to have Full HTML. However, when I create a new block, the default is always Filtered HTML. Node defaults and Comment defaults are correct.

Does anyone have the same problems?

Kit

Comments

dragonwize’s picture

Status: Active » Postponed (maintainer needs more info)

Works on a fresh install and all my sites. I will need more information about your setup and the exact steps you have taken to repeat the issue.

Remember, defaults only show for NEW content.

dragonwize’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

1 month with no activity. Closing.

jweowu’s picture

Status: Closed (fixed) » Active

This bug report is valid, due to the default weighting of the rows in the "better_formats_defaults" table.

The module adds rows for format '0' and weight 25 for all roles. However, because ONLY roles with 'administer blocks' appear in the settings form, it is not obvious that the weight of the 'authenticated user' entry will cause a conflict if the 'authenticated user' role does not have that permission.

If you assign the 'administer blocks' permissions to a new role, the weight assigned for that role's row in "better_formats_defauts" is also 25, and if you choose a format and save without adjusting weights, that default weight of 25 is maintained. The database query then selects formats ordered by weight, and if the weights are identical, the database may return the 'authenticated user' role instead of the role you wanted (which results in the site default format being used, if the authenticated user role cannot administer blocks).

In the meantime, you can work around this bug:

Better formats seems to allocate block format weights at the -25 end of the scale when you re-order roles, and it appears that Drupal's "draggable table" javascript works even with only a single row (so you can 're-order' even a single row by dragging it with the mouse). So even if you don't have a need to reorder the visible roles, do it anyway to sort the weights out.

A simple way to verify the result is to disable javascript in your browser (so that you can assign the weights manually), and make sure that all of your roles have a weight lower than 25.

dragonwize’s picture

Status: Active » Fixed

Thanks for the research jweowu.

I actually went through a lot of trouble to try and prevent this very issue but as is shown I missed 1 scenario. Being when the roles is alphabetically before auth user role.

After looking and thinking through this more I do not see an good way around this other than to show all roles like node and comment. That is a shame because I really liked the idea and look of only showing those with the block admin permission.

Committed a patch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.