Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ctgraham opened this issue Feb 18, 2020 · 6 comments
Closed

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

ctgraham opened this issue Feb 18, 2020 · 6 comments
Assignees
Milestone

Comments

@ctgraham
Copy link
Collaborator

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

@ctgraham ctgraham added this to the OJS/OMP 3.1.2-5 milestone Feb 18, 2020
@ctgraham
Copy link
Collaborator Author

@asmecher
Copy link
Member

@ctgraham, forgive me for losing track of this one -- what is the status of the open PRs linked here?

@ctgraham
Copy link
Collaborator Author

Heh. I was just looking for that horrible installFilters hijack yesterday. There it is.

I think these are still good for merge. stable-3_1_2 is releasable as 1.3 for 3.1.2, and master is releasable as 1.3.1 for 3.2. I haven't actually run the plugin in 3.2, though.

@asmecher
Copy link
Member

asmecher commented Sep 3, 2020

I've added Travis tests to stable-3_2_1 and master branches of the custom block plugin, and will now start looking at the PRs for the stable-3_2_1 branch, thanks!

@asmecher
Copy link
Member

With apologies, @ctgraham, I'm deferring this yet again -- I'm about to release 3.2.1-3 on more urgent matters and don't want to bring in a large last-minute merge. My fault!

@asmecher asmecher modified the milestones: 3.3.0-9, 3.3.0-10 Mar 1, 2022
@NateWr NateWr moved this to Todo in Infrastructure May 9, 2022
@asmecher asmecher modified the milestones: 3.3.0-11, 3.3.0-12 Jun 7, 2022
@asmecher asmecher modified the milestones: 3.3.0-12, 3.3.0-13 Aug 25, 2022
@asmecher
Copy link
Member

After many deferrals -- and with apologies to @ctgraham, who put a lot of thought and effort into this -- I'm going to close this issue. We removed the 2.x to 3.x upgrade toolset with the release of 3.3.0, so this would need to be fixed in 3.2.x or older, which we're not actively maintaining. For anyone encountering this issue, there is a proposed fix in pkp/customBlockManager#61.

Repository owner moved this from Todo to Done in Infrastructure Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
3 participants