In-Portal Issue Tracker - In-Commerce
Viewing Issue Advanced Details
1144 [In-Portal CMS] Install / Upgrages bug report always 2011-10-17 07:49 2012-07-25 05:32
alex  
alex  
normal  
closed 5.1.3  
fixed  
 
none 5.2.0-B1  
https://groups.google.com/d/topic/in-portal-bugs/ov0hRPOKcPM/discussion
Fixed sql error during installation
0
0001144: Checking Affiliate during installation cause sql error
I've noticed, that since 5.1.3 version we've got 1 more error during installation:

SELECT Affiliates.* ,(u.PortalUserId) AS `UserId`,(IF( LENGTH(u.Login), u.Login, '')) AS `UserName`,(ap.Name) AS `PlanName`,(Affiliates.LastPaymentDate) AS `LastPaymentDate_date`,(Affiliates.LastPaymentDate) AS `LastPaymentDate_time`,(Affiliates.LastOrderDate) AS `LastOrderDate_date`,(Affiliates.LastOrderDate) AS `LastOrderDate_time`,(Affiliates.CreatedOn) AS `CreatedOn_date`,(Affiliates.CreatedOn) AS `CreatedOn_time`
FROM Affiliates
LEFT JOIN PortalUser u ON Affiliates.PortalUserId = u.PortalUserId
LEFT JOIN AffiliatePlans ap ON Affiliates.AffiliatePlanId = ap.AffiliatePlanId
WHERE (`Affiliates`.PortalUserId = '-1')
LIMIT 0,1

happening from OrdersEventHandler->isAffiliate method on "Modules to Install" step.


This is because installation wizard now uses the same method for logging user in as Front-End code. That's why I propose to skip affiliate checks during installation.
patch affiliate_on_install_modules_1144.patch (585) 2011-11-02 11:41
http://tracker.in-portal.org/file_download.php?file_id=1288&type=bug
patch affiliate_check_during_installation.patch (1,336) 2011-11-03 06:03
http://tracker.in-portal.org/file_download.php?file_id=1295&type=bug
Issue History
2012-07-25 05:32 alex Note Added: 0005064
2012-07-25 05:32 alex Status resolved => closed
2011-11-03 06:05 alex Note Added: 0004127
2011-11-03 06:05 alex Status reviewed and tested => resolved
2011-11-03 06:05 alex Fixed in Version => 5.2.0-B1
2011-11-03 06:05 alex Resolution open => fixed
2011-11-03 06:05 alex Changeset attached 5.2.x r14729
2011-11-03 06:04 alex Note Added: 0004126
2011-11-03 06:04 alex Status needs testing => reviewed and tested
2011-11-03 06:03 alex File Added: affiliate_check_during_installation.patch
2011-11-02 11:42 erik Note Added: 0004121
2011-11-02 11:42 erik Assigned To erik => alex
2011-11-02 11:42 erik Developer => erik
2011-11-02 11:42 erik Status needs work => needs testing
2011-11-02 11:41 erik File Added: affiliate_on_install_modules_1144.patch
2011-11-01 23:03 Dmitry Note Edited: 0004115 bug_revision_view_page.php?bugnote_id=0004115#r900
2011-11-01 23:03 Dmitry Estimate Points => 0
2011-11-01 23:03 Dmitry Note Added: 0004115
2011-11-01 23:03 Dmitry Assigned To => erik
2011-11-01 23:03 Dmitry Status active => needs work
2011-11-01 23:03 Dmitry Target Version 5.1.4 => 5.2.0
2011-10-17 07:49 alex New Issue
2011-10-17 07:49 alex Reference => https://groups.google.com/d/topic/in-portal-bugs/ov0hRPOKcPM/discussion
2011-10-17 07:49 alex Change Log Message => Fixed sql error during installation

Notes
(0004115)
Dmitry   
2011-11-01 23:03   
Moved to 5.2.0 release

(0004121)
erik   
2011-11-02 11:42   
patch attached - needs testing
(0004126)
alex   
2011-11-03 06:04   
Check was correct, but was performed in a wrong place.

Problem was, that ord:OnUserLogin hook that triggered problematic affiliate check was called after user entered "root" user password during installation. That's the place where IS_INSTALL constant must be checked in this case.
(0004127)
alex   
2011-11-03 06:05   
Fix committed to 5.2.x branch. Commit Message:

Fixes 0001144: Checking Affiliate during installation cause sql error
Commit on behalf of Erik
(0005064)
alex   
2012-07-25 05:32   
Since 5.2.0 version was released.