[OJS 3.2.1] Missing variable when setting reviewer notes

Hi,

We are working on OJS 3.2.1-0 from a tarball using PHP 7.2.

When an editor modifies notes on a reviewer, the following PHP Notice appears in the OJS error_log:

PHP Notice:  Undefined variable: user in /var/www/html/lib/pkp/controllers/grid/users/reviewer/form/ReviewerGossipForm.inc.php on line 70

The code on github pkp-lib master (lib/pkp/controllers/grid/users/reviewer/form/ReviewerGossipForm.inc.php \ReviewerGossipForm::execute):

	function execute(...$functionArgs) {
		$this->_user->setGossip($this->getData('gossip'));
		$userDao = DAORegistry::getDAO('UserDAO'); /* @var $userDao UserDAO */
		$userDao->updateObject($this->_user);
		parent::execute(...$functionArgs);
		return $user;
	}

$user is undefined.

Should this be returning $this->_user , $this, anything at all?

Thanks,

Hi @jp_ecancer,

The return value for ReviewerGossipForm::execute is neither documented nor used anywhere, so I’d recommend simply removing the return statement. Would you be able to file this as a pull request in Github? The file is here: pkp-lib/ReviewerGossipForm.inc.php at stable-3_2_1 · pkp/pkp-lib · GitHub

Thanks,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher ,

PR created: ReviewerGossipForm::execute - remove undefined value by ecancer · Pull Request #6117 · pkp/pkp-lib · GitHub

We will start using PRs more (myself and my colleague @awecancer)

Thanks,

@jp_ecancer

Hi @jp_ecancer,

Thanks for contributing! We’re always happy to have PRs come our way. I’ll work through it with you over on Github.

Regards,
Alec Smecher
Public Knowledge Project Team