Skip to content

Custom Block Plugin upgrade 2.x to 3.x leaves invalid block contexts #5523

@ctgraham

Description

@ctgraham

Describe the bug
The upgrade from 2.x to 3.x does not modify the block context of custom blocks, leaving them orphaned if they existed in BLOCK_CONTEXT_RIGHT_SIDEBAR or BLOCK_CONTEXT_HOMEPAGE

To Reproduce
Steps to reproduce the behavior:

  1. Add custom blocks to a context other than the left sidebar in OJS 2.x
  2. Upgrade to OJS 3.1.2
  3. Navigate to Website Settings -> Appearance
  4. Custom blocks to not appear in the Sidebar or Unselected section of Sidebar Management.

What application are you using?
OJS 3.1.2

Additional information
Original contexts were:

define('BLOCK_CONTEXT_LEFT_SIDEBAR', 0x00000001);
define('BLOCK_CONTEXT_RIGHT_SIDEBAR', 0x00000002);
define('BLOCK_CONTEXT_HOMEPAGE', 0x00000003);

Contexts for 3.1.2 were:
define('BLOCK_CONTEXT_SIDEBAR', 0x00000001);
define('BLOCK_CONTEXT_HOMEPAGE', 0x00000003);

But, only BLOCK_CONTEXT_SIDEBAR is considered:
case BLOCK_CONTEXT_SIDEBAR:
$sidebarBlockPlugins[$key] = $plugins[$key];
break;

But then this constant is entirely removed in 3.2:
a76bac7#diff-70caff5ef9a513397af1833a3e2a3c7c

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions