Editing a existing related link changed the order of the related links which is quite nasty if there many of them (#2332).
git-svn-id: https://svn.libreccm.org/ccm/trunk@3087 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
baefb94ba5
commit
6b67b291a6
|
|
@ -25,7 +25,6 @@ import com.arsdigita.bebop.form.SingleSelect;
|
||||||
import com.arsdigita.bebop.form.TextField;
|
import com.arsdigita.bebop.form.TextField;
|
||||||
import com.arsdigita.bebop.parameters.StringParameter;
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.cms.ContentItem;
|
import com.arsdigita.cms.ContentItem;
|
||||||
import com.arsdigita.cms.ContentSection;
|
|
||||||
import com.arsdigita.cms.ContentType;
|
import com.arsdigita.cms.ContentType;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.contentassets.RelatedLink;
|
import com.arsdigita.cms.contentassets.RelatedLink;
|
||||||
|
|
@ -34,11 +33,11 @@ import com.arsdigita.cms.contentassets.util.RelatedLinkGlobalizationUtil;
|
||||||
import com.arsdigita.cms.contenttypes.Link;
|
import com.arsdigita.cms.contenttypes.Link;
|
||||||
import com.arsdigita.cms.contenttypes.ui.LinkPropertyForm;
|
import com.arsdigita.cms.contenttypes.ui.LinkPropertyForm;
|
||||||
import com.arsdigita.cms.contenttypes.ui.LinkSelectionModel;
|
import com.arsdigita.cms.contenttypes.ui.LinkSelectionModel;
|
||||||
import com.arsdigita.globalization.GlobalizedMessage;
|
|
||||||
import com.arsdigita.mimetypes.MimeType;
|
import com.arsdigita.mimetypes.MimeType;
|
||||||
import com.arsdigita.mimetypes.MimeTypeCollection;
|
import com.arsdigita.mimetypes.MimeTypeCollection;
|
||||||
import com.arsdigita.persistence.DataCollection;
|
import com.arsdigita.persistence.DataCollection;
|
||||||
import com.arsdigita.util.Assert;
|
import com.arsdigita.util.Assert;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -215,7 +214,10 @@ public class RelatedLinkPropertyForm extends LinkPropertyForm {
|
||||||
DataCollection links = RelatedLink.getRelatedLinks(
|
DataCollection links = RelatedLink.getRelatedLinks(
|
||||||
getContentItem(fse.getPageState()),
|
getContentItem(fse.getPageState()),
|
||||||
m_linkListName);
|
m_linkListName);
|
||||||
|
//Only change link order if we are creating a new link
|
||||||
|
if (!getLinkSelectionModel().isSelected(fse.getPageState())) {
|
||||||
rl.setOrder((int) links.size() + 1);
|
rl.setOrder((int) links.size() + 1);
|
||||||
|
}
|
||||||
|
|
||||||
super.setLinkProperties(link, fse);
|
super.setLinkProperties(link, fse);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -72,15 +72,9 @@
|
||||||
<xsl:function name="foundry:get-current-application">
|
<xsl:function name="foundry:get-current-application">
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="$data-tree/@application">
|
<xsl:when test="$data-tree/@application">
|
||||||
<xsl:message>
|
|
||||||
<xsl:value-of select="concat('Found application ', $data-tree/@application)"/>
|
|
||||||
</xsl:message>
|
|
||||||
<xsl:sequence select="$data-tree/@application"/>
|
<xsl:sequence select="$data-tree/@application"/>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:message>
|
|
||||||
<xsl:value-of select="'Found no application.'"/>
|
|
||||||
</xsl:message>
|
|
||||||
<xsl:sequence select="'none'"/>
|
<xsl:sequence select="'none'"/>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
|
|
@ -89,15 +83,9 @@
|
||||||
<xsl:function name="foundry:get-current-application-class">
|
<xsl:function name="foundry:get-current-application-class">
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="$data-tree/@class">
|
<xsl:when test="$data-tree/@class">
|
||||||
<xsl:message>
|
|
||||||
<xsl:value-of select="concat('Found application class ', $data-tree/@class)"/>
|
|
||||||
</xsl:message>
|
|
||||||
<xsl:sequence select="$data-tree/@class"/>
|
<xsl:sequence select="$data-tree/@class"/>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:message>
|
|
||||||
<xsl:value-of select="'Found no class.'"/>
|
|
||||||
</xsl:message>
|
|
||||||
<xsl:sequence select="'none'"/>
|
<xsl:sequence select="'none'"/>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue