User "Krinkle" posted a comment on MediaWiki.r89198.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89198#c17623
Commit summary:

Suppress AFT from all print outputs. I am adding a @media rule, but also
suppressing rendering of the widget in the &printable version (which does
not respect the @media setting when rendered to the screen). I tried just
using the noprint class, but it does not appear to be present in the older
skins.

Comment:

Since I couldn't reproduce the effects on en.wikipedia locally I dug into this 
a little deeper.


'''./includes/Wiki.php''':

This is what happends in trunk 
([http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/Wiki.php?view=markup#l95
 view markup]):
<pre>
        public function performRequest() {
                global $wgServer, $wgUsePathInfo;

                wfProfileIn( __METHOD__ );

                if ( $this->context->request->getVal( 'printable' ) === 'yes' ) 
{
                        $this->context->output->setPrintable();
                }
</pre>


And here's what happends in 1.17wmf1 
([http://svn.wikimedia.org/viewvc/mediawiki/branches/wmf/1.17wmf1/includes/Wiki.php?view=markup#l105
 view markup]):
<pre>
        function checkInitialQueries( $title, $action ) {
                global $wgOut, $wgRequest, $wgContLang;
                if( $wgRequest->getVal( 'printable' ) === 'yes' ) {
                        $wgOut->setPrintable();
                }
</pre>

Aside from being a different method, the result is the same. The changemaker is 
in OutputPage.php where the resourceloader-urls are contructed.

'''./includes/OutputPage.php''':
Here's trunk 
([http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/OutputPage.php?view=markup#l2406
 view markup])
<pre>
                // Propagate printable and handheld parameters if present
                if ( $this->isPrintable() ) {
                        $baseQuery['printable'] = 1;
                }
</pre>

And here's 1.17 
[http://svn.wikimedia.org/viewvc/mediawiki/branches/wmf/1.17wmf1/includes/OutputPage.php?view=markup#l2332
 view markup])
<pre>
                // Propagate printable and handheld parameters if present
                 if ( $wgRequest->getBool( 'printable' ) ) {
                        $baseQuery['printable'] = 1;
                }
</pre>

It totally ignores the previous logic and reads the request directly (and does 
it wrong).

So we don't have to implement printable-detection for situations where 
printable is true but not 'yes' since it's undocumented, unused and already 
removed in the current trunk.
</pre>

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to