<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://pkp.sfu.ca/bugzilla/bugzilla.dtd">

<bugzilla version="4.2.5+"
          urlbase="http://pkp.sfu.ca/bugzilla/"
          
          maintainer="pkp-hosted@sfu.ca"
>

    <bug>
          <bug_id>5231</bug_id>
          
          <creation_ts>2010-03-17 11:58:00 -0700</creation_ts>
          <short_desc>Remove internal author arrays and functions from Submission classes &amp; fix value objects that instantiate DAOs</short_desc>
          <delta_ts>2011-12-12 09:18:55 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>OJS</product>
          <component>General</component>
          <version>2.4.x</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>REOPENED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Matthew Crider">mattcrider</reporter>
          <assigned_to name="PKP Support">pkp-support</assigned_to>
          <cc>alec</cc>
    
    <cc>jerico.dev</cc>
    
    <cc>juan</cc>
    
    <cc>pkp-support</cc>
          
          <cf_alsoaffects>OCS 2.3.x</cf_alsoaffects>
    
    <cf_alsoaffects>OJS 2.3.x</cf_alsoaffects>

      

      

      

          <long_desc isprivate="0">
            <commentid>18876</commentid>
            <who name="Matthew Crider">mattcrider</who>
            <bug_when>2010-03-17 11:58:55 -0700</bug_when>
            <thetext>The Submission class contains an array of authors and various functions to maintain this array from within the submission class.  This code is redundant and authors should be maintained exclusively in the AuthorDAO.  For instance, $monograph-&gt;getAuthors(), if it exists at all, should be an interface to $authorDao-&gt;getAuthorsByMonographId().  Anything necessary to manipulate authors (e.g. getting/setting/deleting/reordering) is already available in the AuthorDAO.

This can be done in OMP without modifying pkp-lib classes, but should be ported to the other apps after the next release.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>18911</commentid>
            <who name="Matthew Crider">mattcrider</who>
            <bug_when>2010-03-19 12:53:49 -0700</bug_when>
            <thetext>Commits that will help backport this to OJS and OCS:
http://github.com/pkp/omp/commit/15e78686b4737dc4a1f6a50d927452c24f277fb9
http://github.com/pkp/omp/commit/7df49ecd3414157ff6e25f177a4169afa41d4899</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>19100</commentid>
            <who name="Juan Pablo Alperin">juan</who>
            <bug_when>2010-04-09 19:56:17 -0700</bug_when>
            <thetext>moving to OJS as reminder to backport</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>20137</commentid>
            <who name="Alec Smecher">alec</who>
            <bug_when>2010-07-20 12:44:38 -0700</bug_when>
            <thetext>Deferring.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>21556</commentid>
            <who name="Matthew Crider">mattcrider</who>
            <bug_when>2010-10-08 11:01:09 -0700</bug_when>
            <thetext>Need to remove calls to the AuthorDAO from within Monograph.

Consider leaving calls to AuthorDAO in Paper and Article classes to maintain backwards-compatibility (but mark as deprecated).</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>21896</commentid>
            <who name="jerico">jerico.dev</who>
            <bug_when>2010-11-02 15:40:01 -0700</bug_when>
            <thetext>Also see the comments in bug #5912: value objects like MonographFile and its decendants (i.e. ArtworkFile) and potentially also corresponding classes in other apps (e.g. ArticleFile, etc.) cannot instantiate their own DAO. What&apos;s especially ugly is that MonographFile, etc. seem to &quot;instantiate themselves&quot;, see getFile(), getFilePath(), etc. which is the wrong way round. The DAO should instantiate the value object and not the value object the DAO to then retrieve itself via it&apos;s own ID using a different object instance.

One example: getFilePath()
		$monographDao =&amp; DAORegistry::getDAO(&apos;MonographDAO&apos;);
		$monograph =&amp; $monographDao-&gt;getMonograph($this-&gt;getMonographId());
		$pressId = $monograph-&gt;getPressId();

We should simply be able to say $this-&gt;getPressId() to retrieve the press id rather than having to &quot;instantiate ourselves&quot;. If this doesn&apos;t work then there&apos;s probably a conceptual error elsewhere.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>21898</commentid>
            <who name="jerico">jerico.dev</who>
            <bug_when>2010-11-02 15:40:56 -0700</bug_when>
            <thetext>*** Bug 5912 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>21899</commentid>
            <who name="jerico">jerico.dev</who>
            <bug_when>2010-11-02 15:45:10 -0700</bug_when>
            <thetext>Same for ArtworkFile::getPermissionFile() - Should be populated when retrieving the file from the DAO. See the different descendants of Submission for good examples how this should be done.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>21900</commentid>
            <who name="jerico">jerico.dev</who>
            <bug_when>2010-11-02 15:46:57 -0700</bug_when>
            <thetext>Same for OMP&apos;s Author::getLocalizedUserGroupName()</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>21901</commentid>
            <who name="jerico">jerico.dev</who>
            <bug_when>2010-11-02 15:51:00 -0700</bug_when>
            <thetext>Re: getLocalizedUserGroupName() - Should be either getUserGroup() or getUserGroupId() rather than a localized user group name. Maybe this shouldn&apos;t even be part of the Author object but be queried from the UserGroupDAO when needed or be some method like UserGroupDAO::getObjectByUserId(), etc. Otherwise we&apos;d have to go on with similar accessors for all dependent entities that happen to be 1:n-related to authors.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>23303</commentid>
            <who name="Juan Pablo Alperin">juan</who>
            <bug_when>2011-03-20 23:45:35 -0700</bug_when>
            <thetext>marking as &quot;also affects&quot; for backporting detection in OCS and OJS.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>23305</commentid>
            <who name="Juan Pablo Alperin">juan</who>
            <bug_when>2011-03-20 23:46:15 -0700</bug_when>
            <thetext>*** Bug 5913 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>23900</commentid>
            <who name="Matthew Crider">mattcrider</who>
            <bug_when>2011-06-03 10:44:09 -0700</bug_when>
            <thetext>Posted to my github for review:

https://github.com/mcrider/ocs/commit/0e04f03effde19ed65a6a6c5a6e2aa829fe3e0c0
https://github.com/mcrider/ojs/commit/7c9240104d100b7adb3adc3cbaf4b575dbc0cd82
https://github.com/mcrider/omp/commit/f489fd247f685e85d97fab19d85dbe011ccd8e59
https://github.com/mcrider/pkp-lib/commit/4b61a74861274103c2d18a20540b47362fa8843e</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>23902</commentid>
            <who name="Matthew Crider">mattcrider</who>
            <bug_when>2011-06-03 14:49:23 -0700</bug_when>
            <thetext>Second pass, removed some convenience methods from Submission class:

https://github.com/mcrider/pkp-lib/commit/731d395cb2f895254c692aec533429a0ccfeae08
https://github.com/mcrider/omp/commit/f489fd247f685e85d97fab19d85dbe011ccd8e59
https://github.com/mcrider/ojs/commit/909e6aa6b49247c31153eb96b7a57bdf0ebfe22d
https://github.com/mcrider/ocs/commit/1a738c7461c1bf36918bcc2899eeb905d7e9f17c</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>23903</commentid>
            <who name="Matthew Crider">mattcrider</who>
            <bug_when>2011-06-03 16:15:05 -0700</bug_when>
            <thetext>Committed to official.  Closing.

https://github.com/pkp/ocs/commit/9facaaf81c911231dff53f2d54223a25a64102ab
https://github.com/pkp/ojs/commit/70a6e682d7d471162101e91b2bab47995f32148a
https://github.com/pkp/omp/commit/d08b3386dc4411ae18d69b76b398eb04611ad581
https://github.com/pkp/pkp-lib/commit/9d72544cc5d89c592f6707101e1403defa4c69aa</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>25864</commentid>
            <who name="Alec Smecher">alec</who>
            <bug_when>2011-11-18 08:02:44 -0800</bug_when>
            <thetext>Matt, there&apos;s still a case where this isn&apos;t working. See https://github.com/pkp/pkp-lib/commit/9d72544cc5d89c592f6707101e1403defa4c69aa#commitcomment-729003 for details.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>25889</commentid>
            <who name="Matthew Crider">mattcrider</who>
            <bug_when>2011-11-23 13:53:59 -0800</bug_when>
            <thetext>Alec, is there a document that shows how metadata adapters work?  This should be a one-line fix, but I have no idea how to reproduce the issue to confirm the fix.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>25890</commentid>
            <who name="Alec Smecher">alec</who>
            <bug_when>2011-11-23 13:58:03 -0800</bug_when>
            <thetext>It&apos;s not clear from the stack trace how it&apos;s being invoked; might as well follow up with Florian on the github comment. The filter stuff is part of the metadata framework, documented at &lt;http://pkp.sfu.ca/wiki/index.php/Metadata_and_Filter_Framework&gt;.</thetext>
          </long_desc>
      
      

    </bug>

</bugzilla>