"Text" block no longer available on page builder, after upgrade 1.9 -> 15.04dev

Bug #1401708 reported by Aaron Wells on 2014-12-11
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
High
Aaron Wells

Bug Description

If you do an upgrade directly from Mahara 1.9 to 15.04dev, the "Text" block isn't available in the block pallette on the page builder. (It should show up next to the "Text" block).

There is no problem if you do a clean install, or if you upgrade from 1.10.

Using git bisect I traced it to this patch: https://reviews.mahara.org/#/c/3943/

Probably the problem is that our code that uses the "Shortcut" category to identify the blocks that should be placed in the shortcut, is not compatible with the code that we used to convert the 1.9 "text box" block into the 1.10 "text" block.

Aaron Wells (u-aaronw) wrote :

Right, so the problem is that new plugins get installed before core upgrades run. So what's happening is this:

1. The new "text" blocktype goes to install. It uses the method install_blocktype_categories_for_plugin() to fill in the plugin's categories. This method looks for the available categories in the "blocktype_category" table. It doesn't find "shortcut" there, so it skips that one, leaving the "text" blocktype in no categories.

2. The core upgrade runs and sets up the "shortcut" category type.

I'll have to do a little research to figure out the best way to resolve this. I'd like to think that it makes more sense to install new plugins *after* running core upgrades and maybe upgrades for existing plugins as well. But certainly before we make a change that big to the install process, we need to look at the code history and determine whether there's a reason why the new plugin installs come first.

Changed in mahara:
status: Confirmed → In Progress
Robert Lyon (robertl-9) wrote :

A short term 'hack' way of dealing with this:

https://reviews.mahara.org/#/c/4331/

Put the blocktype.text upgrade after the adding of the 'shortcut' category option.

Reviewed: https://reviews.mahara.org/4331
Committed: http://gitorious.org/mahara/mahara/commit/f247b267231844b935b25a796c6fb77c9a299ccd
Submitter: Aaron Wells (<email address hidden>)
Branch: master

commit f247b267231844b935b25a796c6fb77c9a299ccd
Author: Robert Lyon <email address hidden>
Date: Mon Mar 2 10:46:13 2015 +1300

Upgrade the blocktype.text after adding 'shortcut' category (Bug #1401708)

what we really want to do is rewrite the order of how plugin are
installed compared to core - but as that won't happen in the short
term what we can do to fix this problem is put the blocktype.text
upgrade after the adding in of the 'shortcut' category item.

Change-Id: Ib2ec695de73754f8e35f2284577e7fdf15fe0a6d
Signed-off-by: Robert Lyon <email address hidden>

Son Nguyen (ngson2000) on 2015-03-13
Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9) on 2015-04-17
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers