ajnyga / tsvConverter

Excel to OJS3 XML conversion tool
GNU General Public License v3.0
17 stars 12 forks source link

Importing Issues create an error #23

Open withanage opened 9 months ago

withanage commented 9 months ago

Reproduce

In OJS 3.3

git clone https://github.com/ajnyga/tsvConverter
php convert.php  exampleAdvanced.xlsx exampleFiles

Import 2017.xml using XML import

Just Tagging @ajnyga and @ronste (as you are active in the plugin currently).

I will look into this in a month , if this is a single issue.

@ajnyga what about renaming the master to main and having a stable-3_3_0 branch to comply with pkp plugins?

PHP Fatal error:  Uncaught Error: Call to a member function getId() on null in /var/www/html/ojs-3_3/lib/pkp/classes/publication/PKPPublication.inc.php:168
Stack trace:
#0 /var/www/html/ojs-3_3/lib/pkp/classes/submission/PKPSubmission.inc.php(423): PKPPublication->getAuthorString()
#1 /var/www/html/ojs-3_3/cache/t_compile/e26d2de610226743d9feff244fb14ef53700227f^7cf1cd52b8ba8108de77f197078de34b733dd394_0.app.frontendobjectsarticle_summary.tpl.php(77): PKPSubmission->getAuthorString()
#2 /var/www/html/ojs-3_3/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_652e1f74273dd5_01191346()
#3 /var/www/html/ojs-3_3/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode()
#4 /var/www/html/ojs-3_3/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(217): Smarty_Template_Compiled->render()
#5 /var/www/html/ojs-3_3/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(386): Smarty_Internal_Template->render()
#6 /var/www/html/ojs-3_3/cache/t_compile/e26d2de610226743d9feff244fb14ef53700227f^26de9c47ced54328a8eb56e39bb4d4079aa049c6_0.app.frontendobjectsissue_toc.tpl.php(168): Smarty_Internal_Template->_subTemplateRender()
#7 /var/www/html/ojs-3_3/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_652e1f74256d05_25013593()
#8 /var/www/html/ojs-3_3/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode()
#9 /var/www/html/ojs-3_3/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(217): Smarty_Template_Compiled->render()
#10 /var/www/html/ojs-3_3/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(386): Smarty_Internal_Template->render()
#11 /var/www/html/ojs-3_3/cache/t_compile/e26d2de610226743d9feff244fb14ef53700227f^fcbc2cabc0d4dff6219d7e4b5d36c1363533cfd8_0.app.frontendpagesissue.tpl.php(51): Smarty_Internal_Template->_subTemplateRender()
#12 /var/www/html/ojs-3_3/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_652e1f74207534_46527998()
#13 /var/www/html/ojs-3_3/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode()
#14 /var/www/html/ojs-3_3/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(217): Smarty_Template_Compiled->render()
#15 /var/www/html/ojs-3_3/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(238): Smarty_Internal_Template->render()
#16 /var/www/html/ojs-3_3/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(134): Smarty_Internal_TemplateBase->_execute()
#17 /var/www/html/ojs-3_3/lib/pkp/classes/template/PKPTemplateManager.inc.php(1208): Smarty_Internal_TemplateBase->display()
#18 /var/www/html/ojs-3_3/pages/issue/IssueHandler.inc.php(110): PKPTemplateManager->display()
#19 /var/www/html/ojs-3_3/lib/pkp/classes/core/PKPRouter.inc.php(397): IssueHandler->view()
#20 /var/www/html/ojs-3_3/lib/pkp/classes/core/PKPPageRouter.inc.php(246): PKPRouter->_authorizeInitializeAndCallRequest()
#21 /var/www/html/ojs-3_3/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPPageRouter->route()
#22 /var/www/html/ojs-3_3/lib/pkp/classes/core/PKPApplication.inc.php(362): Dispatcher->dispatch()
#23 /var/www/html/ojs-3_3/index.php(68): PKPApplication->execute()
#24 {main}   thrown in /var/www/html/ojs-3_3/lib/pkp/classes/publication/PKPPublication.inc.php on line 168, referer: http://localhost/ojs-3_3/index.php/publicknowledge/issue/archive
ronste commented 9 months ago

Yes, that is a known issue that I should have mentioned in the Readme for now. But in the long run we have to find a better way to handle this.

The reasen for this error is that the authers 'userGroupId' is not set corretly because the 'user_group_ref' attribute of the xml auther tag is not compatible with your installation.

There is a $defaultUserGroupRef variable at the beginning of the convert.php script where the locales and the associated user group strings compatible with your system have to be set. Unfortunately we really have to use localized strings here (which might even change from one installation to the other), there are no constants to identify user groups.

I think we anyway need to have a config-file to handle some of the settings for the conversion process. I will create an issue for this.