[Vtigercrm-developers] Hotfix 2 Bug

Martin Allen martin.allen at clystnet.com
Fri Oct 16 06:49:11 GMT 2020


Hi Uma,

Have you tested changing the value of max_scheduled_workflows in
config.inc.php to anything other than 10? If you do, then you'll see that
no matter what value you give in config.inc.php, you can only ever add up
to 10 scheduled workflows.

This is because the function getMaxAllowedScheduledWorkflows() in
/modules/com_vtiger_workflow/VTWorkflowManager.inc has been changed
incorrectly.
It currently (in hotfix 2) uses the vglobal() function to first SET the
global value to 10. (Line 114). Then it retrieves the value. Which is
ALWAYS going to be 10!

Please actually test the issue.

What I believe the intention was when changing this function, was that IF
max_scheduled_workflows has not been set (in config.inc.php) then it would
return 10. However that is not what it is doing.

Martin Allen


*01392 248692 - Main Office01392 690659 - Direct Line*

*[image: signature2]*

Have you visited our website recently? https://www.clystnet.com
<http://www.clystnet.com/>


The information in this email is confidential If you are not the intended
recipient, you must not read or use that information. This email and any
attachments are believed to be virus free however no responsibility is
accepted by Clystnet for any loss or damage arising in any way from receipt
or use thereof. Clystnet Ltd (company reg number 7164503) is based at
Silverdown Park, Fair Oak Close, Clyst Honiton, EX5 2UX


On Fri, 16 Oct 2020 at 06:21, Uma S <uma.s at vtiger.com> wrote:

> Hi Martin & Ruben,
>
> I don't see a point for confusion here, Variables defined in
> config.inc.php will be in global scope. As it's not good practice to change
> this file we moved  to global scope through vglobal api that's it.
>
> You can override the value using the same api. For example: Please do
> follow the 'listview_max_textlength' variable which is defined on
> config.inc.php file and override through vglobals that's helpful.
>
> On Thu, Oct 15, 2020 at 9:56 PM Rubén A. Estrada Orozco <
> rulotec1 at gmail.com> wrote:
>
>> I'm confused now. How and where are we supposed to override the 10 value?
>> Saludos
>>
>> Rubén
>>
>>
>> On Thu, Oct 15, 2020 at 9:57 AM Martin Allen <martin.allen at clystnet.com>
>> wrote:
>>
>>> And that bug says that there should be a variable in config.inc.php that
>>> allows you to specify the max_scheduled_workflows value. Your fix even did
>>> exactly that. But then when making the hotfix, because the variable wasn't
>>> added to config.inc.php when migrating versions, you have also changed how
>>> it gets that variable, and have now made it overwrite whatever value is in
>>> config.inc.php.....
>>>
>>> On 7.3.0 we could specify the value in config.inc.php.... now in Hotfix
>>> 2 we can't?
>>>
>>> Martin Allen
>>>
>>>
>>> *01392 248692 - Main Office01392 690659 - Direct Line*
>>>
>>> *[image: signature2]*
>>>
>>> Have you visited our website recently? https://www.clystnet.com
>>> <http://www.clystnet.com/>
>>>
>>>
>>> The information in this email is confidential If you are not the
>>> intended recipient, you must not read or use that information. This email
>>> and any attachments are believed to be virus free however no responsibility
>>> is accepted by Clystnet for any loss or damage arising in any way from
>>> receipt or use thereof. Clystnet Ltd (company reg number 7164503) is based
>>> at Silverdown Park, Fair Oak Close, Clyst Honiton, EX5 2UX
>>>
>>>
>>> On Thu, 15 Oct 2020 at 15:13, Uma S <uma.s at vtiger.com> wrote:
>>>
>>>> Hi Martin,
>>>>
>>>> Please refer this <https://code.vtiger.com/vtiger/vtigercrm/issues/66> for
>>>> more details, Hard coded value has been moved to globals.
>>>>
>>>> On Thu, Oct 15, 2020 at 1:49 PM Martin Allen <martin.allen at clystnet.com>
>>>> wrote:
>>>>
>>>>> So we're back to the same situation where the maximum number of
>>>>> scheduled workflows is hardcoded in again, just in a much more complicated
>>>>> way!
>>>>> I thought the whole point was to make it a variable set in the config
>>>>> file?
>>>>>
>>>>> Martin Allen
>>>>>
>>>>>
>>>>> *01392 248692 - Main Office01392 690659 - Direct Line*
>>>>>
>>>>> *[image: signature2]*
>>>>>
>>>>> Have you visited our website recently? https://www.clystnet.com
>>>>> <http://www.clystnet.com/>
>>>>>
>>>>>
>>>>> The information in this email is confidential If you are not the
>>>>> intended recipient, you must not read or use that information. This email
>>>>> and any attachments are believed to be virus free however no responsibility
>>>>> is accepted by Clystnet for any loss or damage arising in any way from
>>>>> receipt or use thereof. Clystnet Ltd (company reg number 7164503) is based
>>>>> at Silverdown Park, Fair Oak Close, Clyst Honiton, EX5 2UX
>>>>>
>>>>>
>>>>> On Thu, 15 Oct 2020 at 09:14, Uma S <uma.s at vtiger.com> wrote:
>>>>>
>>>>>> Hi Martin,
>>>>>>
>>>>>> I would like to recall from the other thread, Where we shouldn't
>>>>>> alert the config file settings. Hence max_scheduled_workflows has been
>>>>>> moved to globals.
>>>>>>
>>>>>> Now getScheduledWorkflowsCount() will consider the value from globals
>>>>>> but not config file, You can use the vglobals to reset the constant.
>>>>>>
>>>>>> On Thu, Oct 15, 2020 at 12:35 PM Martin Allen <
>>>>>> martin.allen at clystnet.com> wrote:
>>>>>>
>>>>>>> Tested and confirmed - if you set the variable in your config file
>>>>>>> for max_scheduled_workflows to 20, you can still only create 10 scheduled
>>>>>>> workflows.
>>>>>>>
>>>>>>> Martin Allen
>>>>>>>
>>>>>>>
>>>>>>> *01392 248692 - Main Office01392 690659 - Direct Line*
>>>>>>>
>>>>>>> *[image: signature2]*
>>>>>>>
>>>>>>> Have you visited our website recently? https://www.clystnet.com
>>>>>>> <http://www.clystnet.com/>
>>>>>>>
>>>>>>>
>>>>>>> The information in this email is confidential If you are not the
>>>>>>> intended recipient, you must not read or use that information. This email
>>>>>>> and any attachments are believed to be virus free however no responsibility
>>>>>>> is accepted by Clystnet for any loss or damage arising in any way from
>>>>>>> receipt or use thereof. Clystnet Ltd (company reg number 7164503) is based
>>>>>>> at Silverdown Park, Fair Oak Close, Clyst Honiton, EX5 2UX
>>>>>>>
>>>>>>>
>>>>>>> On Wed, 14 Oct 2020 at 08:53, Uma S <uma.s at vtiger.com> wrote:
>>>>>>>
>>>>>>>> Hi Martin,
>>>>>>>>
>>>>>>>> No! max_scheduled_workflows is a constant which is compared with getScheduledWorkflowsCount().
>>>>>>>> So that it always remains the same.
>>>>>>>>
>>>>>>>> On Wed, Oct 14, 2020 at 1:00 PM Martin Allen <
>>>>>>>> martin.allen at clystnet.com> wrote:
>>>>>>>>
>>>>>>>>> Hi - I've just looked at the commit for fixing the
>>>>>>>>> max_scheduled_workflows issue, and I suspect it has a bug -not tested it
>>>>>>>>> yet, but it looks pretty obvious what will happen.
>>>>>>>>>
>>>>>>>>> In getMaxAllowedScheduledWorkflows() it uses vglobal() to SET
>>>>>>>>> max_scheduled_workflows to 10, then uses the same function to retrieves the
>>>>>>>>> value in max_scheduled_workflows. Which will always be 10 as you just set
>>>>>>>>> it to 10!
>>>>>>>>>
>>>>>>>>> It basically will now ignore whatever value you set in
>>>>>>>>> config.inc.php !
>>>>>>>>>
>>>>>>>>> There should be a separate function to SET a global variable, and
>>>>>>>>> a different one to RETRIEVE the variable (with a default value returned if
>>>>>>>>> not set, which im guessing is what was intended here)
>>>>>>>>>
>>>>>>>>> Martin Allen
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> *01392 248692 - Main Office01392 690659 - Direct Line*
>>>>>>>>>
>>>>>>>>> *[image: signature2]*
>>>>>>>>>
>>>>>>>>> Have you visited our website recently? https://www.clystnet.com
>>>>>>>>> <http://www.clystnet.com/>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> The information in this email is confidential If you are not the
>>>>>>>>> intended recipient, you must not read or use that information. This email
>>>>>>>>> and any attachments are believed to be virus free however no responsibility
>>>>>>>>> is accepted by Clystnet for any loss or damage arising in any way from
>>>>>>>>> receipt or use thereof. Clystnet Ltd (company reg number 7164503) is based
>>>>>>>>> at Silverdown Park, Fair Oak Close, Clyst Honiton, EX5 2UX
>>>>>>>>> _______________________________________________
>>>>>>>>> http://www.vtiger.com/
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> With
>>>>>>>> Best Regards
>>>>>>>> Uma.S
>>>>>>>> Vtiger Team
>>>>>>>> _______________________________________________
>>>>>>>> http://www.vtiger.com/
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> http://www.vtiger.com/
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> With
>>>>>> Best Regards
>>>>>> Uma.S
>>>>>> Vtiger Team
>>>>>> _______________________________________________
>>>>>> http://www.vtiger.com/
>>>>>
>>>>> _______________________________________________
>>>>> http://www.vtiger.com/
>>>>
>>>>
>>>>
>>>> --
>>>> With
>>>> Best Regards
>>>> Uma.S
>>>> Vtiger Team
>>>> _______________________________________________
>>>> http://www.vtiger.com/
>>>
>>> _______________________________________________
>>> http://www.vtiger.com/
>>
>> _______________________________________________
>> http://www.vtiger.com/
>
>
>
> --
> With
> Best Regards
> Uma.S
> Vtiger Team
> _______________________________________________
> http://www.vtiger.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20201016/ea0923a4/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 10550 bytes
Desc: not available
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20201016/ea0923a4/attachment-0001.png>


More information about the vtigercrm-developers mailing list