I need to add additional fields to the submission process. My thought is that I need to build an OJS plugin to extend the submission form, submission storage and display. My first step was to build the equivalent of a HelloWorld as a generic plugin. I did that and posted it to my install of OJS. All of the other plugins have the install step of excuting php tools/upgra.php upgrade and I did that with mine as well.
When I go into the plugin management, the UI hangs (spinning icon as the UI does some Ajax call that doesnât return a result, an error or stop).
This is the project is it sits: GitHub - dewolfe001/iterSubmission: OJS plugin to allow the addition of tracking data used by Ren&Ref.
Is there a walk-through on naming conventions for plugin development?
Has anyone done a plugin that added new fields to the submission content?
Did you check your PHP error log for something that might indicate the problem associated with the endless spinner? That usually means an error got dumped somewhere.
Regards,
Alec Smecher
Public Knowledge Project Team
Hi Alec,
The request to index.php/rekn/$$$call$$$/grid/settings/plugins/settings-plugin-grid/fetch-grid?_=1475700422106 comes back with a 500 error and 0 bytes of content.
With Debug on, the response has references to the other plugins in the debug code (see below), but not the plugin that I added. Itâs a given that my plugin is the issue, but what I donât know is what is it missing that it needs for bare bones functionality. the plugin doesnât have any particular functionality at this point, but I thought it would have enough to be able to activated and deactivated,
All the best,
Shawn
"
Plugin Gallery
All CategoriesMetadata PluginsAuthorization PluginsBlock PluginsCitation Format PluginsCitation Database Connector PluginsCitation Output PluginsCitation Extraction PluginsGateway PluginsGeneric PluginsImport/Export PluginsOAI Metadata Format PluginsPayment PluginsPublic Identifier PluginsReport PluginsTheme Plugins
I checked there.
My include path was going into pkp lib when it should have looked into classes/submissions
05-Oct-2016 20:44:30 UTC] PHP Warning: require_once(/home/reknojs/public_html/lib/pkp/classes/submission/SubmissionMetadataFormImplementation.inc.php): failed to open stream: No such file or directory in /home/reknojs/public_html/lib/pkp/includes/functions.inc.php on line 25
[05-Oct-2016 20:44:30 UTC] PHP Fatal error: require_once(): Failed opening required â/home/reknojs/public_html/lib/pkp/classes/submission/SubmissionMetadataFormImplementation.inc.phpâ (include_path=â/home/reknojs/public_html/lib/pkp/lib/vendor/ezyang/htmlpurifier/library:.:/home/reknojs/public_html/classes:/home/reknojs/public_html/pages:/home/reknojs/public_html/lib/pkp:/home/reknojs/public_html/lib/pkp/classes:/home/reknojs/public_html/lib/pkp/pages:/home/reknojs/public_html/lib/pkp/lib/adodb:/home/reknojs/public_html/lib/pkp/lib/phputf8:/home/reknojs/public_html/lib/pkp/lib/pqp/classes:/home/reknojs/public_html/lib/pkp/lib/smarty:.:/usr/lib/php:/usr/local/lib/phpâ) in /home/reknojs/public_html/lib/pkp/includes/functions.inc.php on line 25
You have: class IterSubmission extends SubmissionMetadataFormImplementation
I have been under the impression that generic plugins should always extend the GenericPlugin: class CustomBlockManagerPlugin extends GenericPlugin class BrowsePlugin extends GenericPlugin class GoogleAnalyticsPlugin extends GenericPlugin class HtmlArticleGalleyPlugin extends GenericPlugin
etc.
My goal is to create a plugin to add fields to the submission process. For me, âGenericâ feels like an incorrect plugin category. What is the ideal category? Has anyone done this before with OJS 3? ie. add fields to the submission forms.
I think that the generic category is the only option you can use in this case.
You just need to use correct hooks.
For example the OpenAIRE plugin adds fields to the submission form, but I do not whether all those hooks work in OJS3 (A new documentation on hooks would be more than welcome)
Since we do not have a documentation regarding hooks, I did a quick version of my own with a grep search. Probably not all of them, but has helped at least me to figure out some hooks.
Thatâs fantastic!
Given a thread that said something to the effect of supporting a modification of the core vs. writing a plugin, I went with the former. I have my new code in place, but the altered template (the submissionMetadataFormTitleFields.tpl file) isnât showing off any of my changes in the submission form. So, Iâm still at the drawing board.
Excellent, thanks for contributing! Weâre soon going to start revamping our technical documentation (particularly the outdated OJS Technical Reference), and part of our efforts there will go into making sure that the documentation can stay updated. Our previous approach didnât lend itself to maintenance well. My hope is that we can move a lot of content into automatically-generated documenting tools like Doxygen â I wonder whether something can be done with the hook registry along those linesâŠ
Regards,
Alec Smecher
Public Knowledge Project Team
Bing! Thanks! That did it. I thought there had to be a cache clearing step and I was running the upgrade script thinking that it would have to clear the cache as a side-effect of introducing the results of an upgrade. Thanks for the tip!