Referral Contests 2 by Siropu

Referral Contests 2 by Siropu [Paid] 2.2.14

No permission to buy (€29.99)
@Siropu Why Referrer fields are not check when using own username in /account/account-details. This should show error message about you can not Referrer yourself.

190792


You can change that from the "Referrer" custom user field general options. Uncheck "Editable only once".

No, user still can edit this field. Please add support Referrer fields are not editable in /account/account-details, ones entered this fields UN-editable. Only can fill-up Referrer fields in new registration and make cannot re-edit after registration complete.
 
When you try to refer yourself you usually get an error. Have you tried that yourself as a regular user?
Only can fill-up Referrer fields in new registration and make cannot re-edit after registration complete.
Sorry, I misunderstood you. The referrer custom user field is set to "Editable only once" and if it is not filled during the registration, it will show up in account details until is filled. That's how it was designed by XF.
 
Also Server error log:

Code:
LogicException: Attempted to set 'siropu_referral_count' while a save was pending without forceSet src/XF/Mvc/Entity/Entity.php:569

Generated by: Nirjonadda Dec 18, 2018 at 6:16 PM

Stack trace

#0 src/XF/Mvc/Entity/Entity.php(542): XF\Mvc\Entity\Entity->set('siropu_referral...', 1)
#1 src/addons/Siropu/ReferralContests/Listener.php(449): XF\Mvc\Entity\Entity->__set('siropu_referral...', 1)
#2 src/addons/Siropu/ReferralContests/Listener.php(327): Siropu\ReferralContests\Listener::rewardReferrer(Object(DBTech\Security\XF\Entity\User))
#3 [internal function]: Siropu\ReferralContests\Listener::userProfileEntityPostSave(Object(XF\Entity\UserProfile))
#4 src/XF/Extension.php(50): call_user_func_array(Array, Array)
#5 src/XF.php(721): XF\Extension->fire('entity_post_sav...', Array, 'XF\\Entity\\UserP...')
#6 src/XF/Mvc/Entity/Entity.php(1202): XF::fire('entity_post_sav...', Array, 'XF\\Entity\\UserP...')
#7 src/XF/Mvc/Entity/Entity.php(1190): XF\Mvc\Entity\Entity->save(true, false)
#8 src/XF/Mvc/FormAction.php(69): XF\Mvc\Entity\Entity->save(true, false)
#9 src/XF/Mvc/FormAction.php(187): XF\Mvc\FormAction->XF\Mvc\{closure}(Object(XF\Mvc\FormAction))
#10 src/XF/Pub/Controller/Account.php(36): XF\Mvc\FormAction->run()
#11 src/XF/Mvc/Dispatcher.php(321): XF\Pub\Controller\Account->actionAccountDetails(Object(XF\Mvc\ParameterBag))
#12 src/XF/Mvc/Dispatcher.php(248): XF\Mvc\Dispatcher->dispatchClass('XF:Account', 'AccountDetails', Object(XF\Mvc\RouteMatch), Object(AddonFlare\PaidRegistrations\XF\Pub\Controller\Account), NULL)
#13 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(AddonFlare\PaidRegistrations\XF\Pub\Controller\Account), NULL)
#14 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#15 src/XF/App.php(2170): XF\Mvc\Dispatcher->run()
#16 src/XF.php(392): XF\App->run()
#17 index.php(20): XF::runApp('XF\\Pub\\App')
#18 {main}

Request state

array(4) {
  ["url"] => string(24) "/account/account-details"
  ["referrer"] => string(47) "/account/account-details"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(12) {
    ["user"] => array(1) {
      ["custom_title"] => string(0) ""
    }
    ["dob_month"] => string(1) "0"
    ["dob_day"] => string(0) ""
    ["dob_year"] => string(0) ""
    ["option"] => array(1) {
      ["show_dob_date"] => string(1) "1"
    }
    ["profile"] => array(2) {
      ["location"] => string(0) ""
      ["website"] => string(0) ""
    }
    ["custom_fields"] => array(4) {
      ["siropu_referrer"] => string(10) "nirjonadda"
      ["skype"] => string(0) ""
      ["facebook"] => string(0) ""
      ["twitter"] => string(0) ""
    }
    ["about_html"] => string(0) ""
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(24) "/account/account-details"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}
 
Also Server error log:

Code:
LogicException: Attempted to set 'siropu_referral_count' while a save was pending without forceSet src/XF/Mvc/Entity/Entity.php:569

Generated by: Nirjonadda Dec 18, 2018 at 6:16 PM

Stack trace

#0 src/XF/Mvc/Entity/Entity.php(542): XF\Mvc\Entity\Entity->set('siropu_referral...', 1)
#1 src/addons/Siropu/ReferralContests/Listener.php(449): XF\Mvc\Entity\Entity->__set('siropu_referral...', 1)
#2 src/addons/Siropu/ReferralContests/Listener.php(327): Siropu\ReferralContests\Listener::rewardReferrer(Object(DBTech\Security\XF\Entity\User))
#3 [internal function]: Siropu\ReferralContests\Listener::userProfileEntityPostSave(Object(XF\Entity\UserProfile))
#4 src/XF/Extension.php(50): call_user_func_array(Array, Array)
#5 src/XF.php(721): XF\Extension->fire('entity_post_sav...', Array, 'XF\\Entity\\UserP...')
#6 src/XF/Mvc/Entity/Entity.php(1202): XF::fire('entity_post_sav...', Array, 'XF\\Entity\\UserP...')
#7 src/XF/Mvc/Entity/Entity.php(1190): XF\Mvc\Entity\Entity->save(true, false)
#8 src/XF/Mvc/FormAction.php(69): XF\Mvc\Entity\Entity->save(true, false)
#9 src/XF/Mvc/FormAction.php(187): XF\Mvc\FormAction->XF\Mvc\{closure}(Object(XF\Mvc\FormAction))
#10 src/XF/Pub/Controller/Account.php(36): XF\Mvc\FormAction->run()
#11 src/XF/Mvc/Dispatcher.php(321): XF\Pub\Controller\Account->actionAccountDetails(Object(XF\Mvc\ParameterBag))
#12 src/XF/Mvc/Dispatcher.php(248): XF\Mvc\Dispatcher->dispatchClass('XF:Account', 'AccountDetails', Object(XF\Mvc\RouteMatch), Object(AddonFlare\PaidRegistrations\XF\Pub\Controller\Account), NULL)
#13 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(AddonFlare\PaidRegistrations\XF\Pub\Controller\Account), NULL)
#14 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#15 src/XF/App.php(2170): XF\Mvc\Dispatcher->run()
#16 src/XF.php(392): XF\App->run()
#17 index.php(20): XF::runApp('XF\\Pub\\App')
#18 {main}

Request state

array(4) {
  ["url"] => string(24) "/account/account-details"
  ["referrer"] => string(47) "/account/account-details"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(12) {
    ["user"] => array(1) {
      ["custom_title"] => string(0) ""
    }
    ["dob_month"] => string(1) "0"
    ["dob_day"] => string(0) ""
    ["dob_year"] => string(0) ""
    ["option"] => array(1) {
      ["show_dob_date"] => string(1) "1"
    }
    ["profile"] => array(2) {
      ["location"] => string(0) ""
      ["website"] => string(0) ""
    }
    ["custom_fields"] => array(4) {
      ["siropu_referrer"] => string(10) "nirjonadda"
      ["skype"] => string(0) ""
      ["facebook"] => string(0) ""
      ["twitter"] => string(0) ""
    }
    ["about_html"] => string(0) ""
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(24) "/account/account-details"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}

Do you get this server error log?
 
Error on XF 2.1 Beta 5.
PHP:
Server error log
XF\Db\Exception: MySQL statement prepare error [1054]: Unknown column 'u2.like_count' in 'field list' src/XF/Db/AbstractStatement.php:217
Generated by: User Dec 26, 2018 at 5:23 AM
Stack trace
            SELECT
                u2.user_id,
                u2.username,
                u2.display_style_group_id,
                u2.avatar_date,
                u2.gravatar,
                u2.like_count,
                u2.message_count,
                u2.trophy_points,
                COUNT(*) AS referral_count
            FROM xf_user AS u1
            LEFT JOIN xf_user AS u2 ON u2.user_id = u1.siropu_referrer_id
            WHERE u1.siropu_referrer_id > 0
            AND u1.register_date >= ?
            AND u1.register_date <= ?
            AND u1.message_count >= ?
            AND u1.is_banned = 0
            AND u2.is_banned = 0
            GROUP BY u1.siropu_referrer_id
            ORDER BY referral_count DESC, u2.user_id ASC
            LIMIT ?
        
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL statement...', 1054, '42S22')
#1 src/XF/Db/Mysqli/Statement.php(39): XF\Db\Mysqli\Statement->getException('MySQL statement...', 1054, '42S22')
#2 src/XF/Db/Mysqli/Statement.php(54): XF\Db\Mysqli\Statement->prepare()
#3 src/XF/Db/AbstractAdapter.php(89): XF\Db\Mysqli\Statement->execute()
#4 src/XF/Db/AbstractAdapter.php(106): XF\Db\AbstractAdapter->query('
            SELECT
                ...', Array)
#5 src/addons/Siropu/ReferralContests/Repository/Contest.php(51): XF\Db\AbstractAdapter->fetchAll('
            SELECT
                ...', Array)
#6 src/addons/Siropu/ReferralContests/Pub/Controller/Contest.php(24): Siropu\ReferralContests\Repository\Contest->getContestTopReferrers(Object(Siropu\ReferralContests\Entity\Contest), 10)
#7 src/XF/Mvc/Dispatcher.php(321): Siropu\ReferralContests\Pub\Controller\Contest->actionIndex(Object(XF\Mvc\ParameterBag))
#8 src/XF/Mvc/Dispatcher.php(248): XF\Mvc\Dispatcher->dispatchClass('Siropu\\Referral...', 'Index', Object(XF\Mvc\RouteMatch), Object(Siropu\ReferralContests\Pub\Controller\Contest), NULL)
#9 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(Siropu\ReferralContests\Pub\Controller\Contest), NULL)
#10 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#11 src/XF/App.php(2177): XF\Mvc\Dispatcher->run()
#12 src/XF.php(392): XF\App->run()
#13 index.php(20): XF::runApp('XF\\Pub\\App')
#14 {main}
Request state
array(4) {
  ["url"] => string(20) "/referral-contests/1"
  ["referrer"] => string(39) "https://domain.com/referral-contests/"
  ["_GET"] => array(1) {
    ["/referral-contests/1"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}
 
Top Bottom