Last modified: 2014-05-14 06:42:38 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T46801, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 44801 - Reviewing new account request on isDeleted()
Reviewing new account request on isDeleted()
Status: RESOLVED WONTFIX
Product: MediaWiki extensions
Classification: Unclassified
ConfirmAccount (Other open bugs)
REL1_19-branch
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-08 17:45 UTC by Juha Tuomala
Modified: 2014-05-14 06:42 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Juha Tuomala 2013-02-08 17:45:25 UTC
frontend/specialpages/actions/ConfirmAccount_body.php
-----8<--------------------------------------------------------------
        protected function showAccountConfirmForm( $msg = '' ) {
                global $wgAccountRequestTypes;

                $out = $this->getOutput();
                $reqUser = $this->getUser();
                $titleObj = $this->getFullTitle();

                $accountReq = $this->accountReq; // convenience
                if ( !$accountReq || $accountReq->isDeleted && !$this->showRejects ) {
                        $out->addHTML( wfMsgHtml('confirmaccount-badid') );
                        $out->returnToMain( true, $titleObj );
                        return;
                }
----->8----------------------------------------------------------


my postgresql has a column:

 acr_deleted             | boolean                  | not null default false


and regardless that particular request is false, it doesn't get reviewed because isDeleted() is true. Is that supposed to be a instance attribute / ORM mapping or a function call? Because treating it as an attribute, it starts working correctly. But I didn't track down its guts, how the instance gets built and what that class contains.

Note that this is 119 branch git checkout.
Comment 1 Juha Tuomala 2013-02-08 17:46:46 UTC
Also note, that that is my current version, WHERE I'VE REMOVED parentheses from isDeleted()
Comment 2 Bartosz Dziewoński 2013-02-08 17:49:31 UTC
	/**
	 * @return bool Request is deleted (either rejected or expired)
	 */
	public function isDeleted() {
		return $this->deleted;
	}

/backend/UserAccountRequest.php, line 286 on git master.
Comment 3 Juha Tuomala 2013-02-08 17:51:51 UTC
Yup, same here in 119. So it breaks somewhere in ORM?
Comment 4 Bartosz Dziewoński 2013-02-08 17:54:17 UTC
This is the first time I'm looking at this extension, but the 'deleted' attribute seems pretty clearly mapped to the 'acr_deleted' database field. No idea what could be causing issues. (Grep that file for acr_deleted to see how it's done.)
Comment 5 Juha Tuomala 2013-02-08 18:03:25 UTC
Don't know. Fact is that it's false in database and it becomes true in that if comparison. I put my money on rotten Postgresql support.
Comment 6 Aaron Schulz 2013-02-08 18:12:49 UTC
The current version of the schema uses as integer column. Using boolean in PG makes queries return 'f' or 't' which then requires more custom logic. The fix would be to ALTER the column to an INTEGER. I think I backported this to 1.20, maybe it didn't make it to the 1.19 branch.
Comment 7 Juha Tuomala 2013-02-08 19:11:44 UTC
Why would anyone store true or false as numbers? Boolean exists in all databases and in http://www.php.net/manual/en/language.types.boolean.php also.

That doesn't make sense, but maybe it makes a mediawiki release, who knows.
Comment 8 Rafael Henrique da Silva Faria 2013-04-04 14:43:44 UTC
I'm with the same problem under PostgreSQL.

I changed the UserAccountRequest.php to make it work:

        /**
         * @return bool Request is deleted (either rejected or expired)
         */
        public function isDeleted() {
                switch($this->deleted) {
                        case 'FALSE': return FALSE; break;
                        case 'TRUE': return TRUE; break;
                }
                return $this->deleted;
        }

With this change, I'm able to use the extension as expected.
Comment 9 Aaron Schulz 2014-05-14 06:42:38 UTC
Such older branches won't be fixed at this point.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links