diff --git a/infolog/inc/class.infolog_ui.inc.php b/infolog/inc/class.infolog_ui.inc.php index 4bc3634e85..99ff4badbd 100644 --- a/infolog/inc/class.infolog_ui.inc.php +++ b/infolog/inc/class.infolog_ui.inc.php @@ -2031,7 +2031,7 @@ class infolog_ui )); break; case 'projectmanager': - $pm_links = array($action_id); + $content['pm_id'] = $action_id; default: // to allow other apps to participate $content['info_subject'] = Link::title($action, $id); $action_ids = explode(',',$action_id); diff --git a/infolog/tests/SetProjectManagerTest.php b/infolog/tests/SetProjectManagerTest.php index 06320c46b5..840486a85b 100644 --- a/infolog/tests/SetProjectManagerTest.php +++ b/infolog/tests/SetProjectManagerTest.php @@ -437,6 +437,26 @@ class SetProjectManagerTest extends \EGroupware\Api\AppTest $this->checkElements(0); } + public function testSetProjectViaURL() + { + // Mock the etemplate call to check the results + $this->ui->tmpl->expects($this->once()) + ->method('exec') + ->with($this->stringContains('infolog.infolog_ui.edit'), + $this->callback(function($info) { + $this->assertEquals($this->pm_id, $info['pm_id']); + return $info['pm_id'] == $this->pm_id; + }) + ); + + // Set up the test - set pm_id vi URL + $_REQUEST['action'] = 'projectmanager'; + $_REQUEST['action_id'] = $this->pm_id; + + // Make a call to edit, looks like pm_id was set, this is initial load + $this->ui->edit(); + } + /** * If the contact is set to a project, and the contact is cleared, that * will also clear the project