<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -36,6 +36,8 @@ Keeping Chyrp up to date is important to make sure that your blog is as safe and
 4. Overwrite your current Chyrp installation files with the new ones.
 5. Restore your config files&lt;sup&gt;1&lt;/sup&gt; back to /includes/.
 6. Upgrade by navigating to [upgrade.php](), and restore any backups.
+7. Re-enable your Modules/Feathers.
+8. Run the upgrader again. It will run the Module/Feather upgrade tasks.
 
 &lt;sup&gt;1&lt;/sup&gt; The config files vary depending on what you're upgrading from. Any of these in are considered &quot;config files&quot;:
 
@@ -92,4 +94,4 @@ Chyrp is multilingual! If your first language isn't English, you can apply a new
 1. Download and unzip the localization.
 1. Upload the `.mo` file to the `includes/locale/` folder. You don't need anything else for the translation to work.
 1. Open your web browser and navigate to your Chyrp administration panel.
-1. Click on the *Settings* tab, and change the *Language* option to the language you just uploaded.
\ No newline at end of file
+1. Click on the *Settings* tab, and change the *Language* option to the language you just uploaded.</diff>
      <filename>README.markdown</filename>
    </modified>
    <modified>
      <diff>@@ -31,35 +31,49 @@
          *     @mixed@
          */
         public function __get($name) {
-            if (isset($this-&gt;$name))
-                return $this-&gt;$name;
-            else {
-                $model_name = get_class($this);
-                $placeholders = (isset($this-&gt;__placeholders) and $this-&gt;__placeholders);
-
-                Trigger::current()-&gt;filter($filtered, $model_name.&quot;_&quot;.$name.&quot;_attr&quot;, $this);
-                if ($filtered !== false)
-                    $this-&gt;$name = $filtered;
-
-                $this-&gt;belongs_to = (array) $this-&gt;belongs_to;
-                $this-&gt;has_many   = (array) $this-&gt;has_many;
-                $this-&gt;has_one    = (array) $this-&gt;has_one;
-                if (in_array($name, $this-&gt;belongs_to) or isset($this-&gt;belongs_to[$name])) {
-                    $class = (isset($this-&gt;belongs_to[$name])) ? $this-&gt;belongs_to[$name] : $name ;
-                    return $this-&gt;$name = new $class($this-&gt;{$name.&quot;_id&quot;});
-                } elseif (in_array($name, $this-&gt;has_many) or isset($this-&gt;has_many[$name])) {
-                    if (isset($this-&gt;has_many[$name]))
-                        list($class, $by) = $this-&gt;has_many[$name];
-                    else
-                        list($class, $by) = array(depluralize($name), $model_name);
-
-                    return $this-&gt;$name = call_user_func(array($class, &quot;find&quot;),
-                                                         array(&quot;where&quot; =&gt; array(strtolower($by).&quot;_id&quot; =&gt; $this-&gt;id),
-                                                               &quot;placeholders&quot; =&gt; $placeholders));
-                } elseif (in_array($name, $this-&gt;has_one)) {
-                    $class = depluralize($name);
-                    return $this-&gt;$name = new $class(null, array(&quot;where&quot; =&gt; array(strtolower($model_name).&quot;_id&quot; =&gt; $this-&gt;id)));
+            $model_name = get_class($this);
+            $placeholders = (isset($this-&gt;__placeholders) and $this-&gt;__placeholders);
+
+            Trigger::current()-&gt;filter($filtered, $model_name.&quot;_&quot;.$name.&quot;_attr&quot;, $this);
+            if ($filtered !== false)
+                $this-&gt;$name = $filtered;
+
+            $this-&gt;belongs_to = (array) $this-&gt;belongs_to;
+            $this-&gt;has_many   = (array) $this-&gt;has_many;
+            $this-&gt;has_one    = (array) $this-&gt;has_one;
+            if (in_array($name, $this-&gt;belongs_to) or isset($this-&gt;belongs_to[$name])) {
+                $class = (isset($this-&gt;belongs_to[$name])) ? $this-&gt;belongs_to[$name] : $name ;
+                if (isset($this-&gt;belongs_to[$name])) {
+                    $opts =&amp; $this-&gt;belongs_to[$name];
+                    $model = oneof(@$opts[&quot;model&quot;], $name);
+                    $match = oneof(@$opts[&quot;by&quot;], strtolower($name));
+                    $where = array_merge(array(&quot;id&quot; =&gt; $this-&gt;{$match.&quot;_id&quot;}),
+                                         (array) @$opts[&quot;where&quot;]);
+                } else {
+                    $model = $name;
+                    $where = array(&quot;id&quot; =&gt; $this-&gt;{$name.&quot;_id&quot;});
+                }
+
+                return $this-&gt;$name = new $model(null, array(&quot;where&quot; =&gt; $where));
+            } elseif (in_array($name, $this-&gt;has_many) or isset($this-&gt;has_many[$name])) {
+                if (isset($this-&gt;has_many[$name])) {
+                    $opts =&amp; $this-&gt;has_many[$name];
+                    $model = oneof($opts[&quot;model&quot;], $name);
+                    $match = oneof(@$opts[&quot;by&quot;], strtolower($name));
+                    $where = array_merge(array($match.&quot;_id&quot; =&gt; $this-&gt;id),
+                                         (array) @$opts[&quot;where&quot;]);
+                } else {
+                    $model = depluralize($name);
+                    $match = $model_name;
+                    $where = array(strtolower($match).&quot;_id&quot; =&gt; $this-&gt;id);
                 }
+
+                return $this-&gt;$name = call_user_func(array($model, &quot;find&quot;),
+                                                     array(&quot;where&quot; =&gt; $where,
+                                                           &quot;placeholders&quot; =&gt; $placeholders));
+            } elseif (in_array($name, $this-&gt;has_one)) {
+                $class = depluralize($name);
+                return $this-&gt;$name = new $class(null, array(&quot;where&quot; =&gt; array(strtolower($model_name).&quot;_id&quot; =&gt; $this-&gt;id)));
             }
         }
 
@@ -109,6 +123,9 @@
             if ($model_name == &quot;visitor&quot;)
                 $model_name = &quot;user&quot;;
 
+            if (!isset($id) and isset($options[&quot;where&quot;][&quot;id&quot;]))
+                $id = $options[&quot;where&quot;][&quot;id&quot;];
+
             $cache = (is_numeric($id) and isset(self::$caches[$model_name][$id])) ? 
                          self::$caches[$model_name][$id] :
                          ((isset($options[&quot;read_from&quot;][&quot;id&quot;]) and isset(self::$caches[$model_name][$options[&quot;read_from&quot;][&quot;id&quot;]])) ?</diff>
      <filename>includes/class/Model.php</filename>
    </modified>
    <modified>
      <diff>@@ -95,7 +95,7 @@
                 else
                     $call = false;
 
-                if ($call === false and method_exists($this-&gt;controller, $method))
+                if ($call != &quot;override&quot; and method_exists($this-&gt;controller, $method))
                     $response = call_user_func_array(array($this-&gt;controller, $method), $args);
                 else
                     $response = false;</diff>
      <filename>includes/class/Route.php</filename>
    </modified>
    <modified>
      <diff>@@ -40,7 +40,7 @@
                     $args = func_get_args();
                     $args[0] = $call;
                     if ($index + 1 == count($name))
-                        return $return == $this-&gt;exists($call) ? call_user_func_array(array($this, &quot;call&quot;), $args) : $return ;
+                        return $this-&gt;exists($call) ? call_user_func_array(array($this, &quot;call&quot;), $args) : $return ;
                     else
                         $return = $this-&gt;exists($call) ? call_user_func_array(array($this, &quot;call&quot;), $args) : $return ;
                 }
@@ -52,7 +52,7 @@
             $arguments = func_get_args();
             array_shift($arguments);
 
-            $return = false;
+            $return = null;
 
             $this-&gt;called[$name] = array();
             if (isset($this-&gt;priorities[$name])) { # Predefined priorities?</diff>
      <filename>includes/class/Trigger.php</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,7 @@
     class Page extends Model {
         public $belongs_to = array(&quot;user&quot;, &quot;parent&quot; =&gt; array(&quot;model&quot; =&gt; &quot;page&quot;));
 
-        public $has_many = array(&quot;children&quot; =&gt; array(&quot;page&quot;, &quot;parent&quot;));
+        public $has_many = array(&quot;children&quot; =&gt; array(&quot;model&quot; =&gt; &quot;page&quot;, &quot;by&quot; =&gt; &quot;parent&quot;));
 
         /**
          * Function: __construct</diff>
      <filename>includes/model/Page.php</filename>
    </modified>
    <modified>
      <diff>@@ -626,7 +626,7 @@
                                              array(&quot;COUNT(post_id) AS total&quot;, &quot;post_id&quot;),
                                              null,
                                              null,
-                                             null,
+                                             array(),
                                              null,
                                              null,
                                              &quot;post_id&quot;);
@@ -645,7 +645,7 @@
                                             array(&quot;MAX(created_at) AS latest&quot;, &quot;post_id&quot;),
                                             null,
                                             null,
-                                            null,
+                                            array(),
                                             null,
                                             null,
                                             &quot;post_id&quot;);</diff>
      <filename>modules/comments/comments.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ad0af46a4d2b7b5ec8a63f3ac2962de14b6a0339</id>
    </parent>
  </parents>
  <author>
    <name>Alex Suraci</name>
    <email>i.am@toogeneric.com</email>
  </author>
  <url>http://github.com/vito/chyrp-site/commit/fc6d342a56651dae8a93077187963df9f57361fc</url>
  <id>fc6d342a56651dae8a93077187963df9f57361fc</id>
  <committed-date>2008-11-20T19:35:51-08:00</committed-date>
  <authored-date>2008-11-20T19:35:51-08:00</authored-date>
  <message>* Greatly increased model has_many/belongs_to flexibility.
* Updated the README.
* Fixed a logic error in Trigger calls.
* For a trigger call to override a Controller's call, they should return
  &quot;override&quot;.
* If $id is not set in a model grab but it's in the &quot;where&quot; option,
  that'll be used so we can keep the caching.</message>
  <tree>19af6b3cb233353dabb0515c097e881e5a05825f</tree>
  <committer>
    <name>Alex Suraci</name>
    <email>i.am@toogeneric.com</email>
  </committer>
</commit>
