OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



New Block Plugin only visible in Setup Step 5

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

New Block Plugin only visible in Setup Step 5

Postby CarlosLlongo » Sat Jun 30, 2012 9:03 am

It's also visible on Plugin Management, but the post title was too large. This problems seems quite common, but I was unable to find a solution on the forum.

So my intention was to modify the User Block Plugin. I followed all the instructions in http://pkp.sfu.ca/wiki/index.php/Writing_a_Block_Plugin.
- Created a copy of the 'user' directory named 'userMod'
- Renamed 'UserBlockPlugin.inc.php' to 'UserModBlockPlugin.inc.php'
- Changed the comments at the top of the file to this:
Code: Select all
/**
 * @file UserModBlockPlugin.inc.php
 *
 * Copyright (c) 2003-2012 John Willinsky
 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
 *
 * @class UserModBlockPlugin
 * @ingroup plugins_blocks_user_mod
 *
 * @brief Class for user block plugin modified
 */

- Changed class name to UserModBlockPlugin
- Changed the return value of getDisplayName to 'plugins.block.usermod.displayName'
- Changed the return value of getDescription to 'plugins.block.usermod.description'
- In index.php changed the code to this:
Code: Select all
<?php
/**
 * @defgroup plugins_blocks_user_mod
 */
/**
 * @file plugins/blocks/userMod/index.php
 *
 * Copyright (c) 2003-2012 John Willinsky
 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
 *
 * @ingroup plugins_blocks_user_mod
 * @brief Wrapper for userMod block plugin.
 *
 */
// $Id$
require_once('UserModBlockPlugin.inc.php');
return new UserModBlockPlugin();
?>

- Changed the locale keys to plugins.block.usermod.x
- In block.tpl changed the translation keys to plugins.block.usermod.x
- versionxml is al follows:
Code: Select all
<version>
   <application>userMod</application>
   <type>plugins.blocks</type>
   <release>1.0.0.0</release>
   <date>2012-06-29</date>
   <lazy-load>1</lazy-load>
   <class>UserModBlockPlugin</class>
</version>


Then I did the upgrade, and set the plugin to appear on the left sidebar. This is what can be found in the database:
In plugin_settings table:
Code: Select all
usermodblockplugin       0    enabled    1   bool
usermodblockplugin       0    seq    2   int
usermodblockplugin       0    context    2   int
usermodblockplugin       1    enabled    1   bool
usermodblockplugin       1    context    1   int
usermodblockplugin       1    seq    1   int

In versions table:
Code: Select all
1    0    0    0    2012-06-30 13:53:18    1    plugins.blocks    usermod    UserModBlockPlugin    1    0


I don't think I have missed anything. All settings are equal to those of the original user plugin. I checked for file permissions, but those are also the same. ¿Anyone knows how to solve this?

Thanks in advance!
Attachments
userMod.tar.gz
(9.83 KiB) Downloaded 97 times
CarlosLlongo
 
Posts: 10
Joined: Mon Jun 25, 2012 8:55 am

Re: New Block Plugin only visible in Setup Step 5

Postby pixocreative » Thu Aug 23, 2012 2:17 am

Hi, was having the same problem, this solved it:

You will need to register the plugin in the OJS database. You can do this by running the following from your OJS root directory on your server:

php tools/upgrade.php upgrade

Regards,

Vincent
Pixo Creative
http://www.pixo-creative.nl
pixocreative
 
Posts: 1
Joined: Thu Aug 23, 2012 2:10 am

Re: New Block Plugin only visible in Setup Step 5

Postby mbria » Mon Sep 30, 2013 2:03 am

I always forget to:
Code: Select all
$ php tools/upgrade.php upgrade


And, as expected... it did the job.

BTW, alec: what about force OJS to register modules each time you visit the module list (drupal style)?
Or what about a "register" button?
It will be easier for those that hate the command line.

Cheers,
m.
mbria
 
Posts: 352
Joined: Wed Dec 14, 2005 4:15 am

Re: New Block Plugin only visible in Setup Step 5

Postby asmecher » Mon Sep 30, 2013 8:23 am

Hi Marc,

Agreed, this is a frustrating problem. Filed for 3.0b: http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=8434

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 5 guests