Problem/Motivation

The only difference between 7.x-1.x and 7.x-2.x is that the latter generates region names with an underscore instead of a hyphen #2160669: Use underscore instead of hyphen for dynamically generated region names. However, this change broke the Block Group integration of the Region Class module.

Proposed resolution

Add a new function blockgroup_region_for_blockgroup() such that contrib modules do not have to guess the separator according to the installed module version.

Remaining tasks

User interface changes

API changes

Comments

znerol’s picture

Status: Active » Needs review
StatusFileSize
new3.75 KB

Something like this perhaps.

Status: Needs review » Needs work

The last submitted patch, 1: add_a_function_to-2486837-1.patch, failed testing.

znerol’s picture

Status: Needs work » Needs review
StatusFileSize
new435 bytes
new3.76 KB
znerol’s picture

StatusFileSize
new4.1 KB
new4.41 KB

I'm not happy with the new function names. Also I hate the brittle substr comparison. Therefore, let's rename blockgroup_region_for_blockgroup() into blockgroup_get_region() and remove blockgroup_region_is_blockgroup() and instead compare against blockgroup_region_list(). Also introduce a static cache for the latter.

Status: Needs review » Needs work

The last submitted patch, 4: add_a_function_to-2486837-4.patch, failed testing.

znerol’s picture

Status: Needs work » Needs review
StatusFileSize
new4.12 KB
new447 bytes

Region list needs to be initialized to an empty array.

znerol’s picture

StatusFileSize
new4.13 KB
new648 bytes

Use references when moving regions into $page['#blockgroups']. This is how it works in HEAD.

znerol’s picture

StatusFileSize
new4.77 KB
new650 bytes

Also use the new function in the test case.

  • znerol committed 15fe8ad on 7.x-2.x
    Issue #2486837 by znerol: Add a function to determine the region...
znerol’s picture

Version: 7.x-2.x-dev » 7.x-1.x-dev
Status: Needs review » Patch (to be ported)
znerol’s picture

StatusFileSize
new4.73 KB

Backport to 7.x-1.x.

znerol’s picture

Status: Patch (to be ported) » Needs review

  • znerol committed c1e008d on 7.x-1.x
    Issue #2486837 by znerol: Add a function to determine the region...
znerol’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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