Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YF 7.0.2] Error while moving calendar events in graphical mode #61

Closed
andrelouca69 opened this issue Nov 21, 2024 · 3 comments
Closed
Assignees

Comments

@andrelouca69
Copy link

andrelouca69 commented Nov 21, 2024

🐞 bug report

Error while moving event on Calendar (graphic mode)

🔥 How to trigger the error

Move the event from one day to another in graphic mode

👎 Actual Behavior

While moving calendar events to another date/time in graphic mode with mouse drag is show's the following error:
"You do not have permission to modify Calendar entries".

✍️ Resolution process

I saw a post that recommended to change line 207 of file "modules/com_vtiger_workflow/WorkFlow.php" from:
if ('' == $this->test) {
return true;
}
return $this->conditionStrategy->evaluate($this->test, $recordModel);

to

return '' == $this->test ? true : false;
return $this->conditionStrategy->evaluate($this->test, $recordModel);

It solved the calendar problem but it caused workflows to stop working.
So it's a non-solution.

⁉️ Complete error message

E_WARNING: Undefined variable $value in /modules/com_vtiger_workflow/VTJsonCondition.php, line 336
#0 modules/com_vtiger_workflow/VTJsonCondition.php:37  >>  VTJsonCondition->checkCondition(,[subject,does not contain,,rawtext,,and,1])
#1 modules/com_vtiger_workflow/Workflow.php:211  >>  VTJsonCondition->evaluate('[{"fieldname":"sendnotification","operation":"is","value":"1","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":0},{"fieldname":"subject","operation":"does not contain","value":"","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"1"}]')
#2 modules/Vtiger/handlers/Workflow.php:129  >>  Workflow->evaluate(,577569)
#3 modules/Vtiger/handlers/Workflow.php:58  >>  Vtiger_Workflow_Handler->performTasks(,[1,2,3,4])
#4 app/EventHandler.php:544  >>  Vtiger_Workflow_Handler->entityAfterSave(,[3,EntityAfterSave,Vtiger_Workflow_Handler,1,,,5,0,0])
#5 app/EventHandler.php:520  >>  App\EventHandler->triggerHandler([3,EntityAfterSave,Vtiger_Workflow_Handler,1,,,5,0,0])
#6 modules/Vtiger/models/Record.php:570  >>  App\EventHandler->trigger('EntityAfterSave')
#7 modules/Calendar/models/Calendar.php:279  >>  Vtiger_Record_Model->save()
#8 modules/Vtiger/actions/Calendar.php:129  >>  Calendar_Calendar_Model->updateEvent(577569)
#9 app/Controller/ExposeMethod.php:68  >>  Vtiger_Calendar_Action->updateEvent()
#10 app/Controller/ExposeMethod.php:81  >>  Vtiger_Calendar_Action->invokeExposedMethod('updateEvent')
#11 include/main/WebUI.php:161  >>  Vtiger_Calendar_Action->process()
#12 index.php:26  >>  Vtiger_WebUI->process()
#13 public_html/index.php:13  >>  require('index.php')
E_WARNING: Undefined variable $value in /modules/com_vtiger_workflow/VTJsonCondition.php, line 339
#0 modules/com_vtiger_workflow/VTJsonCondition.php:37  >>  VTJsonCondition->checkCondition(,[subject,does not contain,,rawtext,,and,1])
#1 modules/com_vtiger_workflow/Workflow.php:211  >>  VTJsonCondition->evaluate('[{"fieldname":"sendnotification","operation":"is","value":"1","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":0},{"fieldname":"subject","operation":"does not contain","value":"","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"1"}]')
#2 modules/Vtiger/handlers/Workflow.php:129  >>  Workflow->evaluate(,577569)
#3 modules/Vtiger/handlers/Workflow.php:58  >>  Vtiger_Workflow_Handler->performTasks(,[1,2,3,4])
#4 app/EventHandler.php:544  >>  Vtiger_Workflow_Handler->entityAfterSave(,[3,EntityAfterSave,Vtiger_Workflow_Handler,1,,,5,0,0])
#5 app/EventHandler.php:520  >>  App\EventHandler->triggerHandler([3,EntityAfterSave,Vtiger_Workflow_Handler,1,,,5,0,0])
#6 modules/Vtiger/models/Record.php:570  >>  App\EventHandler->trigger('EntityAfterSave')
#7 modules/Calendar/models/Calendar.php:279  >>  Vtiger_Record_Model->save()
#8 modules/Vtiger/actions/Calendar.php:129  >>  Calendar_Calendar_Model->updateEvent(577569)
#9 app/Controller/ExposeMethod.php:68  >>  Vtiger_Calendar_Action->updateEvent()
#10 app/Controller/ExposeMethod.php:81  >>  Vtiger_Calendar_Action->invokeExposedMethod('updateEvent')
#11 include/main/WebUI.php:161  >>  Vtiger_Calendar_Action->process()
#12 index.php:26  >>  Vtiger_WebUI->process()
#13 public_html/index.php:13  >>  require('index.php')
: strpos(): Passing null to parameter #2 ($needle) of type string is deprecated in /modules/com_vtiger_workflow/VTJsonCondition.php, line 339
#0 modules/com_vtiger_workflow/VTJsonCondition.php:339  >>  strpos('teste',NULL)
#1 modules/com_vtiger_workflow/VTJsonCondition.php:37  >>  VTJsonCondition->checkCondition(,[subject,does not contain,,rawtext,,and,1])
#2 modules/com_vtiger_workflow/Workflow.php:211  >>  VTJsonCondition->evaluate('[{"fieldname":"sendnotification","operation":"is","value":"1","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":0},{"fieldname":"subject","operation":"does not contain","value":"","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"1"}]')
#3 modules/Vtiger/handlers/Workflow.php:129  >>  Workflow->evaluate(,577569)
#4 modules/Vtiger/handlers/Workflow.php:58  >>  Vtiger_Workflow_Handler->performTasks(,[1,2,3,4])
#5 app/EventHandler.php:544  >>  Vtiger_Workflow_Handler->entityAfterSave(,[3,EntityAfterSave,Vtiger_Workflow_Handler,1,,,5,0,0])
#6 app/EventHandler.php:520  >>  App\EventHandler->triggerHandler([3,EntityAfterSave,Vtiger_Workflow_Handler,1,,,5,0,0])
#7 modules/Vtiger/models/Record.php:570  >>  App\EventHandler->trigger('EntityAfterSave')
#8 modules/Calendar/models/Calendar.php:279  >>  Vtiger_Record_Model->save()
#9 modules/Vtiger/actions/Calendar.php:129  >>  Calendar_Calendar_Model->updateEvent(577569)
#10 app/Controller/ExposeMethod.php:68  >>  Vtiger_Calendar_Action->updateEvent()
#11 app/Controller/ExposeMethod.php:81  >>  Vtiger_Calendar_Action->invokeExposedMethod('updateEvent')
#12 include/main/WebUI.php:161  >>  Vtiger_Calendar_Action->process()
#13 index.php:26  >>  Vtiger_WebUI->process()
#14 public_html/index.php:13  >>  require('index.php')
@rskrzypczak
Copy link
Contributor

Hey, thanks for your issue, although you're describing completely different topics here.

Your calendar problem may be due to two things:

  • lack of permissions to edit this record
  • something went wrong when you tried to edit the record
    If the logs apply to your case, you've incorrectly added your own workflow action to the calendar module.
    //"fieldname":"subject","operation":"does not contain","value":"".
    You've set a condition that the subject field should not contain an empty value, which doesn't make sense and is the cause of the error here. There are other operators for empty values.
    Nevertheless, we'll secure it in the next version of the YF system, thanks ;)

Either way, the graphical view of the calendar has nothing to do with it ;)

PS
Revert your changes from the "modules/com_vtiger_workflow/WorkFlow.php" file because you've just killed all the workflow actions ;)

@rskrzypczak rskrzypczak self-assigned this Jan 10, 2025
@andrelouca69
Copy link
Author

It was really a workflow i created that was validating if the field "subject" was empty that caused this error.
Just changed "empty" to "=" and it solved the problem.

Thanks a lot rskrzypczak.

@andrelouca69
Copy link
Author

It was really a workflow i created that was validating if the field "subject" was empty that caused this error.
Just changed "empty" to "=" and it solved the problem.

Thanks a lot rskrzypczak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants