Custom blocks not shown in Plugin list in OJS 3.0.1

Hi,

I upgraded from 2.4.5.0. to OJS 3.0.1. I inherited custom blocks and I need to customize them, but they are not shown in Plugins list. I only see them in Website Settings–>Appearance were I can activate or deactivate them. Also, I don’t know how to make a new custom block.

Thanks,
Dijana

Hi @dijana,

Find the Custom Block Manager plugin in your list of generic plugins – make sure it’s enabled, and click the link there to add/edit existing blocks.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Thanks a lot. I found the Custom block manager :slight_smile:, however, some blocks can be edited, i.e., their Edit link works, while for others, Edit link does not work. The Url of the editable blocks is proper: …/index.php/jhsci/$$$call$$$/plugins/generic/custom-block-manager/controllers/grid/custom-block-grid/edit-custom-block?blockName=MyBlock

while the URL of non-editable blocks is just ending with # , like this: …management/settings/website#

Thanks,
Dijana

Hi @dijana,

The limitations on naming for custom blocks have changed between OJS 2.x and 3.x – it’s possible that the names you were using in OJS 2.x are no longer allowed under 3.x. Are there any non-alphanumeric characters used in the names of the blocks that aren’t working?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

Exactly. Single-word blocks can be edited, while two-words blocks can not.
Can I fix this somehow? :slight_smile:

Regards,
Dijana

Hi @dijana,

For the moment, the quickest thing to do is to edit the block name in the database.

First, find the customblockmanagerplugin entries in plugin_settings:

select * from plugin_settings where plugin_name='customblockmanagerplugin';

You’ll get a result like…

+--------------------------+------------+--------------+--------------------------+--------------+
| plugin_name              | context_id | setting_name | setting_value            | setting_type |
+--------------------------+------------+--------------+--------------------------+--------------+
| customblockmanagerplugin |          1 | blocks       | a:1:{i:0;s:7:"one two";} | object       |
| customblockmanagerplugin |          1 | enabled      | 1                        | bool         |
+--------------------------+------------+--------------+--------------------------+--------------+

This block’s name is “one two”, and the space is the problem. Edit the entry to replace the space with an underscore (_). (Be careful not to change the length of the name! That 7 in the setting value is the expected string length and PHP will get confused if you modify it.)

Then you’ll need to make the same change to that plugin’s own settings:

select * from plugin_settings where plugin_name='one two';

…will give…

+-------------+------------+--------------+-------------------------------------------+--------------+
| plugin_name | context_id | setting_name | setting_value                             | setting_type |
+-------------+------------+--------------+-------------------------------------------+--------------+
| one two     |          1 | blockContent | a:1:{s:5:"en_US";s:15:"<p>asdfadsf</p>";} | object       |
| one two     |          1 | context      | 1                                         | int          |
| one two     |          1 | enabled      | 1                                         | bool         |
+-------------+------------+--------------+-------------------------------------------+--------------+

Once again, change one two to one_two.

You may have to flush your data cache before the changes will take effect.

Regards,
Alec Smecher
Public Knowledge Project Team

3 Likes

Hi @asmecher,

It worked :slight_smile:. Thanks a lot!

I have another stubborn plugin, the Related Items plugin which does not show on the list of available plugins in Website–>Appearance. Any idea?

Thanks a lot…
Regards,
Dijana

Hi @dijana,

That plugin needs a rewrite for OJS 3.x before it’ll work – I’ve filed this for attention at Related Items plugin needs rewrite for OJS 3.x · Issue #2112 · pkp/pkp-lib · GitHub.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Thanks. This module is not of high priority/urgent to me, but would be nice to have it in the future :slight_smile:

Best regards,
Dijana

Hi @dijana,

Thanks – we derive a lot of our priorities from feedback here!

Regards,
Alec Smecher
Public Knowledge Project Team

Dear Alec,
how we can put custom block on left side of page? In OJS 2.x we have this opportunity but in OJS 3.0.1 I cannot find how to do that.
Regards,
Lazar

We’ve moved from a 3 column to a 2 column layout for the product, but you can reverse the order of display in CSS (OMP example):

Hi @asmecher,

In my 3.0.1 installtion, Custom Block Manager plugin is enabled and I have a few custom blocks migrated from 2.4.6. I have done the update in db to modify the name of the blocks in order to not have space.
The problem is that those blocks are not listed in “Sidebar Management” in “Appearance” tab and therefore not displayed in the sidebar of my website. Would you please assist?

Regards
Ghazal

Hi @salehig,

Did you update both the custom block manager setting, and the rows for each individual block? I suspect those no longer match.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I am afraid I don’t know what you mean by “the rows for each individual block”. Where about in the setting I need to look up?

Regards
Ghazal

Hi @salehig,

Both kinds of edits are described earlier in this thread. Make sure you made both changes.

Regards,
Alec Smecher
Public Knowledge Project Team

I checked I have done both. Is there anything I can check?

Hi @salehig,

Did you flush the data cache?

Regards,
Alec Smecher
Public Knowledge Project Team

Yes I had flushed data cache. I deleted the block and put back in and it is now displayed. One change I noticed is that in my old db I had a forth record for each of the blocks:

+-------------+------------+--------------+-------------------------------------------+--------------+
| plugin_name | context_id | setting_name | setting_value                             | setting_type |
+-------------+------------+--------------+-------------------------------------------+--------------+
| one two     |          1 | blockContent | a:1:{s:5:"en_US";s:15:"<p>asdfadsf</p>";} | object       |
| one two     |          1 | context      | 1                                         | int          |
| one two     |          1 | enabled      | 1                                         | bool         |
| one two     |          1 | seq          | 7                                         | int          |
+-------------+------------+--------------+-------------------------------------------+--------------+

setting_name: seq
This record was not added when I recreated the block.

Hi @salehig,

Hmm… Can you post the actual results for the SELECT queries listed above?

Regards,
Alec Smecher
Public Knowledge Project Team