[Vtigercrm-developers] Another bug in the PBXManager Migration Scripts...

Stacey Johnson stacey.johnson110 at gmail.com
Mon Sep 7 11:08:08 GMT 2015


I did, but I know that sharing it will end up with sharing only and nothing
else.


Stacey



On Mon, Sep 7, 2015 at 3:36 PM, Alan Lord <alanslists at gmail.com> wrote:

> Take a look at the block around 1340 in
> vtiger-6.3.0/modules/Migration/schema/600_to_610.php...
>
> //Query to fetch asterisk extension
>> $extensionResult = $adb->pquery('SELECT userid, asterisk_extension FROM
>> vtiger_asteriskextensions', array());
>> for ($i = 0; $i < $adb->num_rows($extensionResult); $i++) {
>>     $userId = $adb->query_result($extensionResult, 0, 'userid');
>>     $extensionNumber = $adb->query_result($extensionResult, 0,
>> 'asterisk_extension');
>>     $adb->pquery('UPDATE vtiger_users SET phone_crm_extension = ? WHERE
>> id = ?', array($extensionNumber, $userId));
>> }
>>
>
> Notice how you have a counter $i for the number of rows found?
>
> Notice how it *not* used to retrieve the results from each row - hint you
> set it to 0. So this block of code will update admin's (or the first user
> in the system by userid) extension number as many times as there are users,
> but not update any other user in the system.
>
> The whole PBXManager migration routine is totally broken. I am amazed how
> nobody else seems to have noticed any of this...
>
> Al
>
> _______________________________________________
> http://www.vtiger.com/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20150907/8eddf139/attachment.html>


More information about the vtigercrm-developers mailing list