<div>Victor y amigos de reddes,</div><div><br></div><div>Hemos identificado y corrigido un problema en el plugin de multi-language que no permitia el display de las páginas secundarias. </div><div><br></div><div>Es importante actualizar el plugin para poder trabajar con las paginas secundarias generadas en el plugin de BVS-Site.</div>
<div><br></div><div><br></div><div>Abrazos,</div><br clear="all"><span style="font-family:Arial;font-size:13px">Vinicius de Andrade<br><span><font style="font-size:11px"><b>BIREME/OPAS/OMS</b></font></span></span><br>
<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername"></b> <span dir="ltr">&lt;<a href="mailto:noreply@wordpress.org">noreply@wordpress.org</a>&gt;</span><br>Date: Fri, Sep 2, 2011 at 4:44 PM<br>
Subject: [WordPress Plugin][432518] multi-language-framework/trunk: [fix]  parse query for child pages<br>To: <a href="mailto:vinicius.andrade@bireme.org">vinicius.andrade@bireme.org</a><br><br><u></u>




<div>


<div>
<dl>
<dt><span class="Apple-style-span" style="font-size: 15px; font-weight: bold; ">Log Message</span></dt></dl>
<pre>[fix] parse query for child pages
[fix] page translation supports page attributes</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#1322bab9705df703_multilanguageframeworktrunkparse_queryphp">multi-language-framework/trunk/parse_query.php</a></li>
<li><a href="#1322bab9705df703_multilanguageframeworktrunkpost_typesphp">multi-language-framework/trunk/post_types.php</a></li>
</ul>

</div>
<div>
<h3>Diff</h3>
<a></a>
<div><h4>Modified: multi-language-framework/trunk/parse_query.php (432517 =&gt; 432518)</h4>
<pre><span>
<span>--- multi-language-framework/trunk/parse_query.php        2011-09-02 19:41:05 UTC (rev 432517)
+++ multi-language-framework/trunk/parse_query.php        2011-09-02 19:44:16 UTC (rev 432518)
</span><span>@@ -37,15 +37,19 @@
</span><span>         // because we changed the REQUEST_URI so it doesnt know
</span><span>         if ($wp_query-&gt;query_vars[&#39;pagename&#39;]) {
</span><span>             
</span><ins>+            //lets check if there are slashes in the page name, that means a child
+            $pagename = $wp_query-&gt;query_vars[&#39;pagename&#39;];
+            $pagename = str_replace( dirname($pagename) . &#39;/&#39;, &#39;&#39;, $pagename);
+            
</ins><span>             global $wpdb;
</span><span>             
</span><del>-            $post_type = $wpdb-&gt;get_var( $wpdb-&gt;prepare(&quot;SELECT post_type FROM $wpdb-&gt;posts WHERE post_name = %s&quot;, $wp_query-&gt;query_vars[&#39;pagename&#39;]) );
</del><ins>+            $post_type = $wpdb-&gt;get_var( $wpdb-&gt;prepare(&quot;SELECT post_type FROM $wpdb-&gt;posts WHERE post_name = %s&quot;, $pagename) );
</ins><span>             
</span><span>             $wp_query-&gt;query_vars[&#39;post_type&#39;] = $post_type;
</span><span>             //$wp_query-&gt;query_vars[&#39;post_type&#39;] = $post_type . &#39;_t_&#39; . $mlf_config[&#39;current_language&#39;];
</span><del>-            $wp_query-&gt;query_vars[&#39;name&#39;] = $wp_query-&gt;query_vars[&#39;pagename&#39;];
</del><ins>+            $wp_query-&gt;query_vars[&#39;name&#39;] = $pagename;
</ins><span>             $wp_query-&gt;query_vars[$wp_query-&gt;query_vars[&#39;post_type&#39;]] =  $wp_query-&gt;query_vars[&#39;name&#39;];
</span><del>-            $wp_query-&gt;query_vars[&#39;pagename&#39;] = &#39;&#39;;
</del><ins>+            $pagename = &#39;&#39;;
</ins><span>             $wp_query-&gt;is_page = false;
</span><span>             $wp_query-&gt;is_single = true;
</span><span> 
</span><span>@@ -54,7 +58,7 @@
</span><span>             
</span><span>                 &#39;post_type&#39; =&gt; $post_type,
</span><span>                 //&#39;post_type&#39; =&gt; $post_type . &#39;_t_&#39; . $mlf_config[&#39;current_language&#39;],
</span><del>-                &#39;name&#39; =&gt; $wp_query-&gt;query_vars[&#39;pagename&#39;],
</del><ins>+                &#39;name&#39; =&gt; $pagename,
</ins><span>                 $wp_query-&gt;query_vars[&#39;post_type&#39;] =&gt; $wp_query-&gt;query_vars[&#39;name&#39;]
</span><span>                 
</span><span>             );
</span></span></pre></div>
<a></a>
<div><h4>Modified: multi-language-framework/trunk/post_types.php (432517 =&gt; 432518)</h4>
<pre><span>
<span>--- multi-language-framework/trunk/post_types.php        2011-09-02 19:41:05 UTC (rev 432517)
+++ multi-language-framework/trunk/post_types.php        2011-09-02 19:44:16 UTC (rev 432518)
</span><span>@@ -28,12 +28,15 @@
</span><span>             
</span><span>                 case &#39;post&#39;:
</span><span>                     $menu_pos = 5;
</span><ins>+                    $p_type_supports = array(&#39;title&#39;,&#39;editor&#39;,&#39;author&#39;,&#39;thumbnail&#39;,&#39;excerpt&#39;,&#39;comments&#39;);
</ins><span>                     break;
</span><span>                 case &#39;page&#39;:
</span><span>                     $menu_pos = 20;
</span><ins>+                    $p_type_supports = array(&#39;title&#39;,&#39;editor&#39;,&#39;author&#39;,&#39;thumbnail&#39;,&#39;excerpt&#39;,&#39;comments&#39;, &#39;page-attributes&#39;);
</ins><span>                     break;
</span><span>                 default:
</span><span>                     $menu_pos = $wp_post_types[$p_type]-&gt;menu_position ? $wp_post_types[$p_type]-&gt;menu_position : 25;
</span><ins>+                    $p_type_supports = array(&#39;title&#39;,&#39;editor&#39;,&#39;author&#39;,&#39;thumbnail&#39;,&#39;excerpt&#39;,&#39;comments&#39;);
</ins><span>             
</span><span>             }
</span><span>             
</span><span>@@ -44,7 +47,7 @@
</span><span>                 &#39;capability_type&#39; =&gt; $wp_post_types[$p_type]-&gt;capability_type,
</span><span>                 &#39;hierarchical&#39; =&gt; $wp_post_types[$p_type]-&gt;hierarchical == 1,
</span><span>                 &#39;menu_position&#39; =&gt; $menu_pos,
</span><del>-                &#39;supports&#39; =&gt; array(&#39;title&#39;,&#39;editor&#39;,&#39;author&#39;,&#39;thumbnail&#39;,&#39;excerpt&#39;,&#39;comments&#39;)
</del><ins>+                &#39;supports&#39; =&gt; $p_type_supports
</ins><span>             ); 
</span><span>             
</span><span>             //TODO: Post types names can only have 20 chars. Ho to deal with it?
</span><span>@@ -163,9 +166,7 @@
</span><span>     if ($_GET[&#39;action&#39;] != &#39;edit&#39;) {
</span><span>         $translation_of = $_GET[&#39;translation_of&#39;];
</span><span>     } else {
</span><del>-        $translation_of = get_post_meta($post-&gt;ID, &#39;_translation_of&#39;);
-        if (is_array($translation_of))
-            $translation_of = $translation_of[0];
</del><ins>+        $translation_of = get_post_meta($post-&gt;ID, &#39;_translation_of&#39;, true);
</ins><span>     }
</span><span>     
</span><span>     
</span><span>@@ -241,9 +242,9 @@
</span><span>     mlf_add_post_meta($new, &#39;_translation_of&#39;, $original);
</span><span>     
</span><span>     #var_dump($original, $new); die;
</span><del>-    
</del><ins>+
</ins><span>     $also_translation_of = get_post_meta($original, &#39;_translation_of&#39;);
</span><del>-    
</del><ins>+
</ins><span>     if (is_array($also_translation_of)) {
</span><span>         foreach ($also_translation_of as $a) {
</span><span>             if ($a != $new) {
</span><span>@@ -267,11 +268,8 @@
</span><span>     if ( defined(&#39;DOING_AUTOSAVE&#39;) &amp;&amp; DOING_AUTOSAVE ) 
</span><span>         return $post_id;
</span><span> 
</span><del>-    if ( &#39;post&#39; == $_POST[&#39;post_type&#39;] ) {
-        if ( !current_user_can( &#39;edit_post&#39;, $post_id ) )
-            return $post_id;
-    }
</del><span>     
</span><ins>+
</ins><span>     #var_dump($_POST[&#39;_translation_of&#39;]); die;
</span><span>     
</span><span>     mlf_add_translation_relationship($_POST[&#39;_translation_of&#39;], $post_id);
</span></span></pre>
</div>
</div>

</div>

</div><br>