https://bugzilla.wikimedia.org/show_bug.cgi?id=32485

       Web browser: ---
             Bug #: 32485
           Summary: SemanticForms: Creating new articles with `page name'
                    formula is broken.
           Product: MediaWiki extensions
           Version: any
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: critical
          Priority: Unprioritized
         Component: SemanticForms
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


I have a form:

    {{{ info | ... | page name = <unique number;start=1> }}}
    ...

This worked before, but recently broken. It r102365 "strict comparators for
empty strings" caused regression. Look at `specials/SF_FormEdit.php':

    function execute( $query, $redirectOnError = true ) {
        global $wgRequest, $wgOut;
        wfProfileIn( __METHOD__ );
        $this->setHeaders();
        $this->mForm = $wgRequest->getVal( 'form' );
        $this->mTarget = $wgRequest->getVal( 'target' );

If I create a new page and want a name is calculated by formula,  I do not
specify target name, so $target->mTarget is null. Before it was not a problem,
because `( $this->mTarget == '' )' evaluates to true. But not most (all?) of
comparisons converted to `==='. `( $this->mTarget === '' )' evaluates to false,
so execution goes by a path as page name is specified, while actually is not. I
can edit the page, but pressing `Save' causes error …someting about empty
title.

Quick workaround for the problem could be:

    if ( is_null( $this->mTarget ) ) {
        $this->mTarget = '';
    }

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to