[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bricolage-commits
Subject:    [8424] Bret Dawson's fixes for the errors that occurred when
From:       rolfm () bricolage ! cc
Date:       2009-02-26 1:54:57
Message-ID: 20090226015457.D38FBCB9AE () x12 ! develooper ! com
[Download RAW message or body]

Revision: 8424
Author:   rolfm
Date:     2009-02-25 17:54:56 -0800 (Wed, 25 Feb 2009)
ViewCVS:  http://viewsvn.bricolage.cc/?rev=8424&view=rev

Log Message:
-----------
Bret Dawson's fixes for the errors that occurred when subelements were removed from \
an element type, and some credit.

Modified Paths:
--------------
    bricolage/trunk/comp/widgets/container_prof/container.mc
    bricolage/trunk/lib/Bric/Biz/Element/Container.pm
    bricolage/trunk/lib/Bric/Changes.pod
    bricolage/trunk/lib/Bric/License.pod

Modified: bricolage/trunk/comp/widgets/container_prof/container.mc
===================================================================
--- bricolage/trunk/comp/widgets/container_prof/container.mc	2009-02-25 18:26:39 UTC \
                (rev 8423)
+++ bricolage/trunk/comp/widgets/container_prof/container.mc	2009-02-26 01:54:56 UTC \
(rev 8424) @@ -85,8 +85,11 @@
 % }
 
 % if ( $parent && !$top_level) {
-%     my $sub_type = \
                $parent->get_element_type->get_containers($element->get_key_name);
-%     if ( $sub_type->get_min_occurrence < \
$parent->get_elem_occurrence($element->get_key_name) ) { +%     my \
$minimum_occurrence = 0; +%     if (my $sub_type = \
$parent->get_element_type->get_containers($element->get_key_name) ) {  +%         \
$minimum_occurrence = $sub_type->get_min_occurrence; +%     }
+%     if ( $minimum_occurrence < \
$parent->get_elem_occurrence($element->get_key_name) ) {  <div class="delete">
     <& '/widgets/profile/button.mc',
         disp      => $lang->maketext("Delete"),

Modified: bricolage/trunk/lib/Bric/Biz/Element/Container.pm
===================================================================
--- bricolage/trunk/lib/Bric/Biz/Element/Container.pm	2009-02-25 18:26:39 UTC (rev \
                8423)
+++ bricolage/trunk/lib/Bric/Biz/Element/Container.pm	2009-02-26 01:54:56 UTC (rev \
8424) @@ -1551,7 +1551,11 @@
                 $delete_count{$elem_name}++;
 
                 # Get the minimum occurrence for this parent/child relation
-                my $min_occur = $subelement_type->get_min_occurrence;
+                # Assume minimum occurrence of zero if child not present in parent \
type +                my $min_occur = 0;
+                if ($subelement_type) {
+                    $min_occur = $subelement_type->get_min_occurrence;
+                }
 
                 my $occur_diff = $self->get_elem_occurrence($elem_name) - \
$min_occur;  

Modified: bricolage/trunk/lib/Bric/Changes.pod
===================================================================
--- bricolage/trunk/lib/Bric/Changes.pod	2009-02-25 18:26:39 UTC (rev 8423)
+++ bricolage/trunk/lib/Bric/Changes.pod	2009-02-26 01:54:56 UTC (rev 8424)
@@ -157,6 +157,13 @@
 =item *
 
 Fixed bug where IE7 couldn't open the sidenav.  [Kahil Jallad]
+
+=item *
+
+Fixed bug where removing a subelement or custom field from an element type
+would result in an error when editting a story with one of those elements.
+[Bret Dawson] 
+
 =back
 
 =head1 VERSION 1.11.1 (2008-10-03)

Modified: bricolage/trunk/lib/Bric/License.pod
===================================================================
--- bricolage/trunk/lib/Bric/License.pod	2009-02-25 18:26:39 UTC (rev 8423)
+++ bricolage/trunk/lib/Bric/License.pod	2009-02-26 01:54:56 UTC (rev 8424)
@@ -282,6 +282,14 @@
 
 =item * Adrian Yee
 
+=item * Matt Rolf
+
+=item * Sarah Mercier
+
+=item * Michael Herring
+
+=item * Kahil Jallad
+
 =back
 
 Friends who have spotted bugs include:
@@ -442,8 +450,6 @@
 
 =item * Dan McGarry
 
-=item * Matt Rolf
-
 =item * Daisuke Maki
 
 =item * Dawn Buie


[Attachment #3 (text/html)]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style \
type="text/css"><!-- #msg dl { border: 1px #006 solid; background: #369; padding: \
6px; color: #fff; } #msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: \
verdana,arial,helvetica,sans-serif; font-size: 10pt;  } #msg dl a { font-weight: \
bold} #msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: \
bold; } #msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: \
6px; } #msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: \
6px; } #patch { width: 100%; }
#patch h4 {font-family: \
verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
 #patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, \
#patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins \
{background:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del \
{background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, \
                .info {color:#888;background:#fff;}
--></style>
<title>[8424] Bret Dawson's fixes for the errors that occurred when \
subelements</title> </head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a \
href="http://viewsvn.bricolage.cc/?rev=8424&amp;view=rev">8424</a></dd> \
<dt>Author</dt> <dd>rolfm</dd> <dt>Date</dt> <dd>2009-02-25 17:54:56 -0800 (Wed, 25 \
Feb 2009)</dd> </dl>

<h3>Log Message</h3>
<pre>Bret Dawson's fixes for the errors that occurred when subelements were removed \
from an element type, and some credit.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#bricolagetrunkcompwidgetscontainer_profcontainermc">bricolage/trunk/comp/widgets/container_prof/container.mc</a></li>
 <li><a href="#bricolagetrunklibBricBizElementContainerpm">bricolage/trunk/lib/Bric/Biz/Element/Container.pm</a></li>
 <li><a href="#bricolagetrunklibBricChangespod">bricolage/trunk/lib/Bric/Changes.pod</a></li>
 <li><a href="#bricolagetrunklibBricLicensepod">bricolage/trunk/lib/Bric/License.pod</a></li>
 </ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="bricolagetrunkcompwidgetscontainer_profcontainermc"></a>
<div class="modfile"><h4>Modified: \
bricolage/trunk/comp/widgets/container_prof/container.mc (8423 => 8424)</h4> <pre \
class="diff"><span> <span class="info">--- \
bricolage/trunk/comp/widgets/container_prof/container.mc	2009-02-25 18:26:39 UTC (rev \
                8423)
+++ bricolage/trunk/comp/widgets/container_prof/container.mc	2009-02-26 01:54:56 UTC \
(rev 8424) </span><span class="lines">@@ -85,8 +85,11 @@
</span><span class="cx"> % }
</span><span class="cx"> 
</span><span class="cx"> % if ( $parent &amp;&amp; !$top_level) {
</span><del>-%     my $sub_type = \
                $parent-&gt;get_element_type-&gt;get_containers($element-&gt;get_key_name);
                
-%     if ( $sub_type-&gt;get_min_occurrence &lt; \
$parent-&gt;get_elem_occurrence($element-&gt;get_key_name) ) { </del><ins>+%     my \
$minimum_occurrence = 0; +%     if (my $sub_type = \
$parent-&gt;get_element_type-&gt;get_containers($element-&gt;get_key_name) ) {  +%    \
$minimum_occurrence = $sub_type-&gt;get_min_occurrence; +%     }
+%     if ( $minimum_occurrence &lt; \
$parent-&gt;get_elem_occurrence($element-&gt;get_key_name) ) { </ins><span \
class="cx"> &lt;div class=&quot;delete&quot;&gt; </span><span class="cx">     \
&lt;&amp; '/widgets/profile/button.mc', </span><span class="cx">         disp      \
=&gt; $lang-&gt;maketext(&quot;Delete&quot;), </span></span></pre></div>
<a id="bricolagetrunklibBricBizElementContainerpm"></a>
<div class="modfile"><h4>Modified: bricolage/trunk/lib/Bric/Biz/Element/Container.pm \
(8423 => 8424)</h4> <pre class="diff"><span>
<span class="info">--- bricolage/trunk/lib/Bric/Biz/Element/Container.pm	2009-02-25 \
                18:26:39 UTC (rev 8423)
+++ bricolage/trunk/lib/Bric/Biz/Element/Container.pm	2009-02-26 01:54:56 UTC (rev \
8424) </span><span class="lines">@@ -1551,7 +1551,11 @@
</span><span class="cx">                 $delete_count{$elem_name}++;
</span><span class="cx"> 
</span><span class="cx">                 # Get the minimum occurrence for this \
parent/child relation </span><del>-                my $min_occur = \
$subelement_type-&gt;get_min_occurrence; </del><ins>+                # Assume minimum \
occurrence of zero if child not present in parent type +                my $min_occur \
= 0; +                if ($subelement_type) {
+                    $min_occur = $subelement_type-&gt;get_min_occurrence;
+                }
</ins><span class="cx"> 
</span><span class="cx">                 my $occur_diff = \
$self-&gt;get_elem_occurrence($elem_name) - $min_occur; </span><span class="cx"> 
</span></span></pre></div>
<a id="bricolagetrunklibBricChangespod"></a>
<div class="modfile"><h4>Modified: bricolage/trunk/lib/Bric/Changes.pod (8423 => \
8424)</h4> <pre class="diff"><span>
<span class="info">--- bricolage/trunk/lib/Bric/Changes.pod	2009-02-25 18:26:39 UTC \
                (rev 8423)
+++ bricolage/trunk/lib/Bric/Changes.pod	2009-02-26 01:54:56 UTC (rev 8424)
</span><span class="lines">@@ -157,6 +157,13 @@
</span><span class="cx"> =item *
</span><span class="cx"> 
</span><span class="cx"> Fixed bug where IE7 couldn't open the sidenav.  [Kahil \
Jallad] </span><ins>+
+=item *
+
+Fixed bug where removing a subelement or custom field from an element type
+would result in an error when editting a story with one of those elements.
+[Bret Dawson] 
+
</ins><span class="cx"> =back
</span><span class="cx"> 
</span><span class="cx"> =head1 VERSION 1.11.1 (2008-10-03)
</span></span></pre></div>
<a id="bricolagetrunklibBricLicensepod"></a>
<div class="modfile"><h4>Modified: bricolage/trunk/lib/Bric/License.pod (8423 => \
8424)</h4> <pre class="diff"><span>
<span class="info">--- bricolage/trunk/lib/Bric/License.pod	2009-02-25 18:26:39 UTC \
                (rev 8423)
+++ bricolage/trunk/lib/Bric/License.pod	2009-02-26 01:54:56 UTC (rev 8424)
</span><span class="lines">@@ -282,6 +282,14 @@
</span><span class="cx"> 
</span><span class="cx"> =item * Adrian Yee
</span><span class="cx"> 
</span><ins>+=item * Matt Rolf
+
+=item * Sarah Mercier
+
+=item * Michael Herring
+
+=item * Kahil Jallad
+
</ins><span class="cx"> =back
</span><span class="cx"> 
</span><span class="cx"> Friends who have spotted bugs include:
</span><span class="lines">@@ -442,8 +450,6 @@
</span><span class="cx"> 
</span><span class="cx"> =item * Dan McGarry
</span><span class="cx"> 
</span><del>-=item * Matt Rolf
-
</del><span class="cx"> =item * Daisuke Maki
</span><span class="cx"> 
</span><span class="cx"> =item * Dawn Buie
</span></span></pre>
</div>
</div>

</body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic