Fix one thing - break another... How about moving get_db_versions, compare_versions, and check_depends back inside the loop - check phpgwapi for update - and if ['status'] == 'U' - do an upgrade for phpgwapi before the loop start?
Regards Sigurd > From: Benoit Hamet [EMAIL PROTECTED] > Sent: 2006-10-04 12:23:45 CEST > To: [email protected] > Subject: Re: [Phpgroupware-developers] setup broken for phpgwapi upgrade in > HEAD > > Hi Sigurd, Hi all, > > I'm not sure I agree with the way you correct the problem. > > Let me explain what I understand from the old code base. > > The purpose was to upgrade the whole installation, with a loop in case > of cross dependencies ... > > So that was working fine until now for all apps, excluding the phpgwapi > for a reason I will explain later. > > But the modification you made, let me think that the when a cross > dependancy will be found, the whole process will loop, since apps are > not updated after beeing installed ... > > So I propose the following : > > Instead of moving the code for $setup_info = > $GLOBALS['phpgw_setup']->detection->get_db_versions($setup_info); > $setup_info = > $GLOBALS['phpgw_setup']->detection->compare_versions($setup_info); > $setup_info = > $GLOBALS['phpgw_setup']->detection->check_depends($setup_info); > > > Outside the loop, > > let in in place (in the loop), and change the condition for updating the > $pass array ... > If you take a look at that parts, > foreach($setup_info as $key => $value) > { > if ( isset($value['name']) > && $value['name'] != 'phpgwapi' > && $value['status'] == 'U' ) > { > > You will understand why the phpgwapi is never updated in the current code. > > In fact if you read the upgrade method, you will read this : > if ( isset($setup_info[$key]['status']) > && ($setup_info[$key]['status'] == 'U' > || $setup_info[$key]['status'] == 'D' > || $setup_info[$key]['status'] == 'V' > || $setup_info[$key]['status'] == '' ) ) // TODO this is not getting > set for api upgrade, sometimes ??? > { > > Of course, this is not setted, because $setup_info['phpgwapi'] was never > updated > > So the process was borken because the former test was not trying to see > if $setup_info[$key]['status'] == '' which is true if > $setup_info[$key]['status'] is not set ... so phpgwapi was upgraded > even if not needed ... > > I don't know if the way I want to correct it won't break things ... it's > very hard to change things in this portion of code, since it's really > hard to test it. > > Anyway, I'm open to discuss. > > Regards, > > BenoƮt. > > > > > > Sigurd Nes wrote: > > Benoit Hamet wrote: > >> Hi all, > >> > >> I just notice that's there is some problem in upgrading the tables in > >> the HEAD version. > >> > >> I found the problem (at least something looking as it), and have > >> informed Dave about it. > >> > >> btw, only phpgwapi is concerned, and I guess that's a very old bug that > >> the E_ALL fixes just show up :) > >> > >> Should be fixed tommorow morning for me. > >> > >> Regards. > >> > >> Caeies > >> > > I had the same problem - so I took the liberty of fixing it (committed). > > > > Regards > > > > Sigurd > > > > > > _______________________________________________ > > Phpgroupware-developers mailing list > > [email protected] > > http://lists.gnu.org/mailman/listinfo/phpgroupware-developers > > > > > > _______________________________________________ > Phpgroupware-developers mailing list > [email protected] > http://lists.gnu.org/mailman/listinfo/phpgroupware-developers >
_______________________________________________ Phpgroupware-developers mailing list [email protected] http://lists.gnu.org/mailman/listinfo/phpgroupware-developers
