Custom blocks not shown in Plugin list in OJS 3.0.1

Hi @salehig,

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

Regards,
Alec Smecher
Public Knowledge Project Team

mysql> select * from plugin_settings where plugin_name='customblockmanagerplugin';
+--------------------------+------------+--------------+---------------------------+--------------+
| plugin_name              | context_id | setting_name | setting_value             | setting_type |
+--------------------------+------------+--------------+---------------------------+--------------+
| customblockmanagerplugin |          1 | enabled      | 1                         | bool         |
| customblockmanagerplugin |          1 | blocks       | a:1:{i:0;s:8:"QUT_Logo";} | object       |
+--------------------------+------------+--------------+---------------------------+--------------+

mysql> select * from plugin_settings where plugin_name='QUT_Logo';
+-------------+------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+
| plugin_name | context_id | setting_name | setting_value                                                                                                                                                                                                                   | setting_type |
+-------------+------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+
| qut_logo    |          1 | blockContent | a:1:{s:5:"en_US";s:196:"<p><span class="blockTitle">Supported by</span></p>
<p id="logoBlock"><a href="http://www.qut.edu.au/"><img src="/public/journals/1/qutlogo.gif" alt="Queensland University of Technology"></a></p>";} | object       |
| qut_logo    |          1 | context      | 2                                                                                                                                                                                                                               | int          |
| qut_logo    |          1 | enabled      | 1                                                                                                                                                                                                                               | bool         |
| qut_logo    |          1 | seq          | 5                                                                                                                                                                                                                               | int          |
+-------------+------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+
4 rows in set (0.00 sec)

mysql> select * from plugin_settings where setting_name='seq';
+-----------------------------+------------+--------------+---------------+--------------+
| plugin_name                 | context_id | setting_name | setting_value | setting_type |
+-----------------------------+------------+--------------+---------------+--------------+
| helpblockplugin             |          0 | seq          | 1             | int          |
| donationblockplugin         |          0 | seq          | 5             | int          |
| notificationblockplugin     |          0 | seq          | 3             | int          |
| userblockplugin             |          0 | seq          | 2             | int          |
| navigationblockplugin       |          0 | seq          | 5             | int          |
| developedbyblockplugin      |          0 | seq          | 0             | int          |
| languagetoggleblockplugin   |          0 | seq          | 4             | int          |
| fontsizeblockplugin         |          0 | seq          | 6             | int          |
| roleblockplugin             |          1 | seq          | 1             | int          |
| informationblockplugin      |          1 | seq          | 4             | int          |
| subscriptionblockplugin     |          1 | seq          | 3             | int          |
| developedbyblockplugin      |          1 | seq          | 0             | int          |
| helpblockplugin             |          1 | seq          | 1             | int          |
| userblockplugin             |          1 | seq          | 0             | int          |
| notificationblockplugin     |          1 | seq          | 3             | int          |
| languagetoggleblockplugin   |          1 | seq          | 6             | int          |
| navigationblockplugin       |          1 | seq          | 7             | int          |
| donationblockplugin         |          1 | seq          | 8             | int          |
| fontsizeblockplugin         |          1 | seq          | 8             | int          |
| keywordcloudblockplugin     |          1 | seq          | 3             | int          |
| readingtoolsblockplugin     |          1 | seq          | 2             | int          |
| announcementfeedblockplugin |          1 | seq          | 5             | int          |
| externalfeedblockplugin     |          1 | seq          | 5             | int          |
| qutnavigationblockplugin    |          1 | seq          | 0             | int          |
| qut_logo                    |          1 | seq          | 5             | int          |
| sponsors                    |          1 | seq          | 6             | int          |
+-----------------------------+------------+--------------+---------------+--------------+
26 rows in set (0.00 sec)

None of the block plugins are displayed. I guess some of the build in ones are decommissioned in the new version though.

Hi @salehig,

Make sure your block names match completely – for example, QUT_Logo is not the same as qut_logo.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks @asmecher. I tried that and then flushed data cache. It didn’t help.

Hi @salehig,

Can you post more recent results for those queries?

Regards,
Alec Smecher
Public Knowledge Project Team

Sure.

   mysql> select * from plugin_settings where plugin_name='customblockmanagerplugin';
    +--------------------------+------------+--------------+---------------------------+--------------+
    | plugin_name              | context_id | setting_name | setting_value             | setting_type |
    +--------------------------+------------+--------------+---------------------------+--------------+
    | customblockmanagerplugin |          1 | enabled      | 1                         | bool         |
    | customblockmanagerplugin |          1 | blocks       | a:1:{i:0;s:8:"qut_logo";} | object       |
    +--------------------------+------------+--------------+---------------------------+--------------+
    2 rows in set (0.00 sec)

mysql> select * from plugin_settings where plugin_name='qut_logo';
+-------------+------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+
| plugin_name | context_id | setting_name | setting_value                                                                                                                                                                                                                   | setting_type |
+-------------+------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+
| qut_logo    |          1 | blockContent | a:1:{s:5:"en_US";s:196:"<p><span class="blockTitle">Supported by</span></p>
<p id="logoBlock"><a href="http://www.qut.edu.au/"><img src="/public/journals/1/qutlogo.gif" alt="Queensland University of Technology"></a></p>";} | object       |
| qut_logo    |          1 | context      | 2                                                                                                                                                                                                                               | int          |
| qut_logo    |          1 | enabled      | 1                                                                                                                                                                                                                               | bool         |
| qut_logo    |          1 | seq          | 5                                                                                                                                                                                                                               | int          |
+-------------+------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+
4 rows in set (0.00 sec)

Hi @salehig,

Hmm, I’m a little confused after a few rounds of debugging on this. It sounds like you were able to successfully re-create one of your custom block plugins, but you also say that none of the block plugins are working properly. Could you describe the current state of your system?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

My point is that the solution provided above (modifying db records) didn’t work for me. I have to delete and re-create all the custom blocks to be able to to make them display. I am doing these on our dev website at the moment. We are going to do the migrate for our production website in a week. So our preference is to have the least changes needed after the site is up.

Best Regards
Ghazal

Hi @salehig,

Could you try comparing the database entries for a custom block, both before you delete and re-create it, and afterwards? Try to make the block exactly the same, so the comparison will easily show the distinguishing factor.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

The difference I found was that each there are three records corresponding to each custom block newly generated with three setting_name: enabled, context, and blockContent, while for the old ones there are 4 records. The forth has a setting_name of “seq”.

Also I noticed before any changes to database records, “Delete” and “Upgrade” are missing next to “Manage Custom Blocks” in plugin setting page. Please see attached.

I was testing this on a different ojs instance (still 3.0.1) which the block name doesn’t have a space or any special characters in. It is simply called “Sponsors”.

Thanks
Ghazal

Hi @salehig,

Can you confirm whether adding a seq setting to the database for a pre-upgrade custom block corrects the issue?

Regards,
Alec Smecher
Public Knowledge Project Team

thank you all
i need to customize menu in right sidebar area but in Custom Block not appear any CSS cod
if there any way to make it visible please i need help
thanks.
Ramy Khalil

Sorry if I am not in the right topic or place to post, I am quite new here.
I am on OJS3.1.0.1, language FRENCH. All my plugins are available and their name correct when I choose English , but when I configure language in French, they all have “##” at the beginning and end or their name. I thougth it was the same problem, so i typed : select * from plugin_settings where plugin_name=‘customblockmanagerplugin’;
And I got the following, which is different from what you show. Is there a problem explaining my difficulties with the plugin

| plugin_name | context_id | setting_name | setting_value | setting_type |
±-------------------------±-----------±-------------±--------------±-------------+
| customblockmanagerplugin | 1 | enabled | 0 | bool |

Hi @cverger,

The French translation is incomplete in parts; when a translation string is missing, you’ll see ##names.like.this## in their place. See http://pkp.sfu.ca/wiki/index.php/Translating_OxS for information on translations.

Regards,
Alec Smecher
Public Knowledge Project Team

Falling in same issue migrating a journal to OJS 3.1.1

Cleaning the DB did the trick. A query to find the plugins with issues:

select * from plugin_settings where plugin_name LIKE "% %"

Cheers,
m.

Hi,
In OJS 3.1.1 when try to add Custom block received only loading. In PHP error received>
PHP Fatal error: Call to a member function getSetting() on string in /home/stranip/public_html/plugins/generic/customBlockManager/controllers/grid/form/CustomBlockForm.inc.php on line 90
Where is the problem?
Lazar

Hi @Lazar_Stosic,

See e.g. [SOLVED] Custom Block Manager didnt save.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
Thank you a lot. The problem is solved.
Regards,
Lazar

Missed to report a summary of the fix (for future references).

  1. Ensure the plugin_name is EXACTLY the same everywhere (be carefully with upper/lower case).

    SELECT * from plugin_settings 
    WHERE plugin_name='customblockmanagerplugin'`
    
  2. Fix context of every custom module. They need to be 1:

    SELECT * FROM `plugin_settings` 
    WHERE `setting_value` != '1'
    AND `setting_name` = 'context';`
    
  3. Sort your blocks and clear cache:

    • Visit Settings > Website > Appearance
    • Visit Administratiron > Clear Template Cache

That’s all.