Jump to content

[4.4.7 Bug Report] Clear Incomplete members task not working


teraßyte

Recommended Posts

Posted

I recall reading we should report bugs here now? Not 100% sure though... 🙄

 

Anyway, the task applications/core/tasks/clearincompletemembers.php is not properly cleaning up incomplete accounts for those who signed up with FB/Twitter/etc. We've noticed this issue for a while now, but today I had a better look at it and figured out the issue.

The problem is caused by this code on line 54:

foreach ( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'core_members', array( array( '(name=? OR email=?)', '', '' ), array( '! (members_bitoptions2 & 16384 ) AND joined<? AND (last_visit=0 OR last_visit IS NULL)', \IPS\DateTime::create()->sub( new \DateInterval( 'PT1H' ) )->getTimestamp() ) ) ), 'IPS\Member' ) as $incompleteMember )

The query fails to load any row because the check last_visit=0 fails since the column in the DB contains the value NULL instead. I changed that bit of code to account for both values and the task is working as it should now:

(last_visit=0 OR last_visit IS NULL)


Full code:

foreach ( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'core_members', array( array( '(name=? OR email=?)', '', '' ), array( '! (members_bitoptions2 & 16384 ) AND joined<? AND (last_visit=0 OR last_visit IS NULL)', \IPS\DateTime::create()->sub( new \DateInterval( 'PT1H' ) )->getTimestamp() ) ) ), 'IPS\Member' ) as $incompleteMember )

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...