Moving submission from one journal to another on multi-journal site

I am using OJS3.1.1.1, with two journals on one site.

I have a number of users who have submitted to one journal, when in fact we need to move them to the second Journal.

I have done this by playing around with the database (I know, bad idea), by changing the context_id and the section_id. This works, in the sense that the submission appears under the second Journal.

However, I cannot access this submission:
You don’t currently have access to that stage of the workflow.

even though I am listed as Journal Manager, Section Editor, Journal Editor.

Does anyone know of a solution?

Thanks

Stephen

Hi @ssciberras,

There are a lot of other dependent entities you’d have to adjust. For example, the submission now points to the new journal, but the stage_assignments entries will now point to user_groups that still exist in the first journal, not the second.

Regards,
Alec Smecher
Public Knowledge Project Team

dear asmecher,

thanks - i am slowly realising that it involves more work than anticipated.

So far, I see that to do so:

  1. ‘context_id’ in ‘submissions’ needs to be changed to the new journal

  2. ‘section_id’ in ‘submissions’ needs to be changed

  3. the location of the submitted files need to be moved from journal1/articles/sumbission_id to the second journal

  4. stage_assignments needs to be adjusted

I was hoping to integrate this on the submission page, with a pop up that directs the user to send the submission to the chosen journal, using a php script in the background.

anything else?

Thanks

Stephen

Hi @ssciberras,

I would probably miss a few if I attempted to list all the things you’d need to change, but off the top of my head, you may also have problems with the notifications table (the assoc_type/assoc_id pairs may refer to content that doesn’t match the context_id values).

Regards,
Alec Smecher
Public Knowledge Project Team

I am working on a plugin for this, and making slow progress.

I can get the submission data, and change it, but then how do i update the database?

$submissionDao = Application::getSubmissionDAO();
$submissionDao = DAORegistry::getDAO(‘ArticleDAO’);

$submission = $submissionDao->getById($request->getUserVar(‘submissionId’), 6, false);

$submission->setdata ( ‘contextId’, $newJournalID);
$submission->setdata ( ‘journalId’, $newJournalID);
$submission->setJournalId ( ‘3’ );

$submissionDAO->updateObject($submission);

However, I am getting an error:
PHP Fatal error: Call to a member function updateObject() on null

I do not understand how to move from here

thanks

stephen

Hi @ssciberras,

That’s a typo – you refer to $submissionDao as $submissionDAO. (This looks like experimental code, but beware also of trusting user input – the submissionId request parameter could be something you don’t want to expose.)

Regards,
Alec Smecher
Public Knowledge Project Team

oh sugar…

took me hours looking at that code. At least now I am progressing more, and things are easier.

thanks

stephen

Nearly ready now…

One thing remains: notifications. I am half way there, but what is the assoc_id, is it the same as the id of the submission?

I find some assoc_id in the DB that are larger than the submission_id… hence my request

Once this is sorted, I can think about the interface

Thanks

Stephen

Hi @ssciberras,

See e.g. "Assoc_Type" And Metrics Table OJS - #2 by asmecher and Migrating group settings from one journal to another - #2 by asmecher for information on the assoc_type / assoc_id pattern we use in the database.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks

Managed nicely. Now onto the gui.

Do you have a guide on how to provide a link to open an ajax modal form?

Regards

Stefe

Hi @ssciberras,

Have a look e.g. at lib/pkp/templates/authorDashboard/submissionEmails.tpl, which is the template that generates links for the author to view emails in a modal.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks @asmecher

I have already managed to inject a linkaction into the workflow tpl. However, although the modal is appearing, I still cannot populate it.

So far, I have tried a variety of examples, but none have worked… I am sure it is something small…

My linkaction class:

import('lib.pkp.classes.linkAction.LinkAction');
class ChangeJournalLinkAction extends LinkAction {

	/**
	 * Constructor
	 * @param $request Request
	 * @param $submissionId integer The submission to change.
   * @param $image string
	 */
	function __construct($request,  $image = 'information') {
		// Instantiate the modal.
		$dispatcher = $request->getDispatcher();
    $router = $request->getRouter();
		import('lib.pkp.classes.linkAction.request.AjaxModal');

		$actionArgs = array();
    
    //url($request, $newContext = null, $component = null, $op = null, $path = null, $params = null, $anchor = null, $escape = false) {
		$modal = new AjaxModal(
      
  		$dispatcher->url(
				$request, ROUTE_COMPONENT, null,
				'plugins.generic.changejournal.ChangeJournalHandler',
				'fetch'
			),
			__('changeJournal.modalTitle'),
			'modal_more_info'
		);

		// Configure the link action.
		$toolTip = ($image == 'completed') ? __('grid.action.galleyInIssueEntry') : null;
		parent::__construct('issueEntry', $modal, __('submission.issueEntry'), $image, $toolTip);
	}
}

Should I use router or dispatcher? is the format correct?

Then, using a HookRegistry::register(‘LoadHandler’, array($this, ‘callbackLoadHandler’));

I start my form, but I still get an AJAX / JSON incorrect alert, and a 404 error on my PHP error log.

thanks

Stpehen

I have changed approach, and kind of making progress, but i cannot figure out some things.

My code now is the following:

Linkaction to create the link
class ChangeJournalLinkAction extends LinkAction {

	/**
	 * Constructor
	 * @param $request Request
	 * @param $submissionId integer The submission to change.
   * @param $image string
	 */
	function __construct($request,  $image = 'information') {
		// Instantiate the modal.
		$dispatcher = $request->getDispatcher();
    $router = $request->getRouter();
		import('lib.pkp.classes.linkAction.request.AjaxModal');

		$actionArgs = array();
    
    //url($request, $newContext = null, $component = null, $op = null, $path = null, $params = null, $anchor = null, $escape = false) {
		$modal = new AjaxModal(
      
  		$dispatcher->url(
				$request, ROUTE_COMPONENT, null,
				'plugins.generic.changejournal.ChangeJournalHandler',
				'fetchForm'
			),
			__('changeJournal.modalTitle'),
			'modal_more_info'
		);

		// Configure the link action.
		$toolTip = ($image == 'completed') ? __('grid.action.galleyInIssueEntry') : null;
		parent::__construct('issueEntry', $modal, __('submission.issueEntry'), $image, $toolTip);
	}
}

which generates the link: http://mmsjournals.org/index.php/test/$$$call$$$/plugins/generic/changejournal/change-journal/fetch-form

And to catch this link:

function callbackLoadHandler ($hookName, $args) {
    if ($args[0] === "plugins.generic.changejournal.ChangeJournalHandler" && $args[1] === "fetchForm") {
      
            error_log ( "********  trial  ************");

      
			$args[0] = "plugins.generic.changejournal.modals.ChangeJournalForm";
			import($args[0]);
      $testing = new ChangeJournalForm(6, null, $this->getTemplatePath().'ChangeJournalForm.tpl');
      $request = Application::getRequest();
      $templateMgr = TemplateManager::getManager($request);      
      
      error_log ( "********  from testing  ************");

      $templateMgr->fetchjson($this->getTemplatePath().'ChangeJournalForm.tpl');
      return true;
			return $templateMgr->fetchjson($this->getTemplatePath().'ChangeJournalForm.tpl');
		}
     
		return false;
  }

However, the modal is still empty, the AJAX response is formed, but not sent, and i still get a ojs2:404 error.

any help?

thanks

stephen