Since DA is out for Drupal 7, it's time to get started with D7 port of Domain Blocks as well.

CommentFileSizeAuthor
#12 950184patch2.patch2.94 KBnonsie
#10 do-950184.patch2.36 KBnonsie

Comments

nonsie’s picture

Trying to find the best way to do it for D7:
Blocks in D6 were quite simple animals compared to D7. In D6 user would see block per theme and would have no indication the block might be enabled in some other theme. DA based filter would apply to the block no matter what theme was used.
In D7 all themes are shown on the block config screen. In D6 Domain Blocks would apply domain based filter (db_rewrite_sql) based on block's defining module and delta which used to be enough. In D7 it almost seems like it needs to be something extra so that it could be really defined per block per theme. At the same time core block visibility is still defined per module/delta combo not block id e.g. the visibility for the block in all themes is the same.

agentrickard’s picture

Off the top of my head, I would approach this the way node visibility does. If people want per-theme and per-domain, then Domain Theme would be required.

nonsie’s picture

Assigned: Unassigned » nonsie

Domain Theme would still not get per-theme and per-domain since Domain Blocks saves visibility per block no matter which theme it is rendered in.
But I think your approach is the most straightforward way to go even though per theme/per domain issue is doomed to come up sooner than later.

Also in D6 domain visibility settings used to appear before visibility settings fieldset - in D7 I'm going to move them there since there's no per-theme/per-domain settings and it logically makes sense to have visibility settings by pages, content types, roles, users and domains.

jonaswouters’s picture

subscribing. Any progress?

nonsie’s picture

Check out HEAD. AFAIK it works but I could use someone else to verify it before I roll a release.

jonaswouters’s picture

I've tried the HEAD and most of the functionality seems to be working...

but I get the following error when opening an inactive views block:
Notice: Undefined variable: block in _domain_blocks_load() (line 313 of /domain_blocks/domain_blocks.module).

nonsie’s picture

Status: Active » Postponed (maintainer needs more info)

Is the number of records in your blocks and domain_blocks tables the same? This error would make sense if these two tables were out of sync.

jonaswouters’s picture

No the number of records are not the same.
There are a couple of blocks missing in the domain_blocks table. All from the module 'views'
The ones missing have an unreadable delta (looks like a md5)

I'll try to delete these views tomorrow. Even if this fixes it, it should not happen?

nonsie’s picture

Status: Postponed (maintainer needs more info) » Needs work

I'm wondering how Views in D7 adds its blocks. It might be doing something different from D6.

nonsie’s picture

Status: Needs work » Needs review
StatusFileSize
new2.36 KB

This patch should fix the issue

jonaswouters’s picture

Patch removed the error but also the domain options in block configuration.
Why remove "$form_id == 'block_admin_configure' " ? Restoring that returns the error...

This time the errors occurs when editing a new menu_block.

nonsie’s picture

StatusFileSize
new2.94 KB

Duh moment.

nonsie’s picture

Status: Needs review » Fixed

Comitted

agentrickard’s picture

I assume this was targeted at DA 7.x.2. You may need to branch to support 7.x.3, but hopefully not.

jonaswouters’s picture

Thanks. Released version works.

nonsie’s picture

It should work for both as Domain Blocks is only using domain_id field from DA. Other modules (Domain Locale/Relationships/Meta) are going to need a bigger overhaul to get them working for 7.x.3 branch.

Status: Fixed » Closed (fixed)

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