We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

There is no active plugin with key `pluginkey` [SOLVED] | Forum

Guna
Guna Nov 4 '14
Hi Friends, 


I am creating a custom plugin for my site. I got the error "There is no active plugin with key `pluginkey`" while I activate the plugin. I made some changes, in the plugin and deactivated it. Then while activating the plugin, I got this error.


I have given activate.php code for your reference.


OW::getNavigation()->addMenuItem(OW_Navigation::MAIN, 'enquiry.create', 'enquiry', 'main_menu_item', 


OW_Navigation::VISIBLE_FOR_ALL);


$widgetService = BOL_ComponentAdminService::getInstance();$widget = $widgetService->addWidget('ENQUIRY_CMP_UserProfile', false);


$widgetPlace = $widgetService->addWidgetToPlace($widget, BOL_ComponentService::PLACE_DASHBOARD);


$widgetService->addWidgetToPosition($widgetPlace, BOL_ComponentService::SECTION_RIGHT);


$widgetService1 = BOL_ComponentAdminService::getInstance();


$widget1 = $widgetService1->addWidget('ENQUIRY_CMP_SiblingsProfile', false);


$widgetPlace1 = $widgetService1->addWidgetToPlace($widget1, BOL_ComponentService::PLACE_DASHBOARD);


$widgetService1->addWidgetToPosition($widgetPlace1, BOL_ComponentService::SECTION_RIGHT);


$widgetService2 = BOL_ComponentAdminService::getInstance();


$widget2 = $widgetService2->addWidget('ENQUIRY_CMP_SpecialDetails', false);


$widgetPlace2 = $widgetService2->addWidgetToPlace($widget2, BOL_ComponentService::PLACE_DASHBOARD);


$widgetService2->addWidgetToPosition($widgetPlace2, BOL_ComponentService::SECTION_RIGHT);


$widgetService3 = BOL_ComponentAdminService::getInstance();


$widget3 = $widgetService3->addWidget('ENQUIRY_CMP_DocDetails', false);


$widgetPlace3 = $widgetService3->addWidgetToPlace($widget3, BOL_ComponentService::PLACE_DASHBOARD);


$widgetService3->addWidgetToPosition($widgetPlace3, BOL_ComponentService::SECTION_RIGHT);


$widgetService4 = BOL_ComponentAdminService::getInstance();


$widget4 = $widgetService4->addWidget('ENQUIRY_CMP_ParentPhoto', false);


$widgetPlace4 = $widgetService3->addWidgetToPlace($widget4, BOL_ComponentService::PLACE_DASHBOARD);


$widgetService4->addWidgetToPosition($widgetPlace4, BOL_ComponentService::SECTION_RIGHT);


What is going wrong? I reload the plugins page, then the plugin is in activated stage.


If my question is not understandable, Please inform.

The Forum post is edited by Daisy Nov 24 '14
ross Team
ross Nov 4 '14
Topic was moved from Bug reports and troubleshooting.
Daisy Team
Daisy Nov 5 '14
Guna, first of all the code you've provided is incorrect. You shouldn't add different variables or call the BOL_ComponentAdminService method several times. Here is the example of the correct code:


OW::getNavigation()->addMenuItem(OW_Navigation::MAIN, 'enquiry.create', 'enquiry', 'main_menu_item', OW_Navigation::VISIBLE_FOR_ALL);

$widgetService = BOL_ComponentAdminService::getInstance();
$widget = $widgetService->addWidget('ENQUIRY_CMP_UserProfile', false);
$widgetPlace = $widgetService->addWidgetToPlace($widget, BOL_ComponentService::PLACE_DASHBOARD);
$widgetService->addWidgetToPosition($widgetPlace, BOL_ComponentService::SECTION_LEFT, 0);

$widget = $widgetService->addWidget('ENQUIRY_CMP_SiblingsProfile', false);
$widgetPlace = $widgetService->addWidgetToPlace($widget, BOL_ComponentService::PLACE_DASHBOARD);
$widgetService->addWidgetToPosition($widgetPlace, BOL_ComponentService::SECTION_LEFT, 0);

$widget = $widgetService->addWidget('ENQUIRY_CMP_SpecialDetails', false);
$widgetPlace = $widgetService->addWidgetToPlace($widget, BOL_ComponentService::PLACE_DASHBOARD);
$widgetService->addWidgetToPosition($widgetPlace, BOL_ComponentService::SECTION_LEFT, 0);

$widget = $widgetService->addWidget('ENQUIRY_CMP_DocDetails', false);
$widgetPlace = $widgetService->addWidgetToPlace($widget, BOL_ComponentService::PLACE_DASHBOARD);
$widgetService->addWidgetToPosition($widgetPlace, BOL_ComponentService::SECTION_LEFT, 0);

$widget = $widgetService->addWidget('ENQUIRY_CMP_ParentPhoto', false);
$widgetPlace = $widgetService->addWidgetToPlace($widget, BOL_ComponentService::PLACE_DASHBOARD);
$widgetService->addWidgetToPosition($widgetPlace, BOL_ComponentService::SECTION_LEFT, 0);


As to the error message - did you change the plugin folder name? Please check if the plugin folder name, plugin key and the plugin module name (ow_base_plugin table) are the same.

I suggest that you download our new Plugin Skeleton plugin to see how to use this or that function. Here is URL to the Store item: http://www.oxwall.org/store/item/695
Guna
Guna Nov 5 '14
@Daisy. Really thanks for this. Regarding the error message, I haven't changed the folder name, plugin key and plugin module name.


I checked `ow_base_plugin` table,the module and key are same.

The Forum post is edited by Guna Nov 5 '14
Daisy Team
Daisy Nov 24 '14
This problem may occur only in one of these conditions:

1. Plugin name and plugin module do not match in the database.

2. Plugin name in the plugin.xml file does not match with the plugin name or plugin module in the database.

3. Plugin name in the plugin.xml file does not match with the plugin name in the functions described in the activate.php file.

Could you please provide me with the screenshots of:

- plugin.xml file
- database entries
- activate.php file
- the error message
Guna
Guna Nov 24 '14
Thanks Daisy for your very detailed information. I have rectified the problem. Please change the status of this question as solved. I had a problem in activate.php file. I changed it.