We are moving to Git Issues for bug tracking in future releases. During transition, content will be in both tools. If you'd like to file a new bug, please create an issue.

Bug 7988 - Email to All institutional subscribers in Editor "Notify users" function broken
Email to All institutional subscribers in Editor "Notify users" function broken
Status: RESOLVED FIXED
Product: OJS
Classification: Unclassified
Component: Editors
2.3.9
All All
: P3 normal
Assigned To: Michael Felczak
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-29 09:15 PDT by linghe4
Modified: 2012-10-29 15:44 PDT (History)
2 users (show)

See Also:
Version Reported In:
Also Affects:


Attachments
Patch against OJS 2.3.8 (should also work with 2.3.7, 2.3.6, etc.) (1.00 KB, patch)
2012-10-29 15:40 PDT, Michael Felczak
Details | Diff
Patch against OJS 2.4.1 (1.00 KB, patch)
2012-10-29 15:40 PDT, Michael Felczak
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description linghe4 2012-10-29 09:15:01 PDT
Should add function &getSubscribedUsers to classes/subscription/InstitutionalSubscriptionDAO.inc.php


 function &getSubscribedUsers($journalId, $rangeInfo = null) {
		$result =& $this->retrieveRange(
			'SELECT	u.*
			FROM	subscriptions s,
				subscription_types st,
				users u
			WHERE	s.type_id = st.type_id AND
				st.institutional = 0 AND
				s.user_id = u.user_id AND
				s.journal_id = ?
			ORDER BY u.last_name ASC, s.subscription_id',
			array((int) $journalId),
			$rangeInfo
		);

		$userDao =& DAORegistry::getDAO('UserDAO');
		$returner = new DAOResultFactory($result, $userDao, '_returnUserFromRow');

		return $returner;
	}
Comment 1 Michael Felczak 2012-10-29 15:25:02 PDT
Notify users institutional subscribers broken
https://github.com/pkp/ojs/commit/b7051a671e4e36ebb26ae552d331d5d8d04c6a48
Comment 2 Michael Felczak 2012-10-29 15:35:01 PDT
Notify users institutional subscribers broken
https://github.com/pkp/ojs/commit/79580e4a5fa6e0998db09cda8ea9ebb2a085feaf
Comment 3 Michael Felczak 2012-10-29 15:35:02 PDT
Notify users institutional subscribers broken
https://github.com/pkp/ojs/commit/3aac4db3fb0b0f4bd8aac4501a5aaef757e3d42b
Comment 4 Michael Felczak 2012-10-29 15:38:02 PDT
(In reply to comment #0)
> Should add function &getSubscribedUsers to
> classes/subscription/InstitutionalSubscriptionDAO.inc.php
> ....
> 			WHERE	s.type_id = st.type_id AND
> 				st.institutional = 0 AND

Thanks for the bug report.

Please see the attached patch for a fix, which differs slightly from the suggested patch above (i.e. st.institutional = 1).
Comment 5 Michael Felczak 2012-10-29 15:40:01 PDT
Created attachment 3883 [details]
Patch against OJS 2.3.8 (should also work with 2.3.7, 2.3.6, etc.)
Comment 6 Michael Felczak 2012-10-29 15:40:39 PDT
Created attachment 3884 [details]
Patch against OJS 2.4.1
Comment 7 Michael Felczak 2012-10-29 15:44:03 PDT
Fixed.