Needs review
Project:
Business Rules
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Jul 2019 at 08:40 UTC
Updated:
30 Jan 2023 at 17:00 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
lexsoft00 commentedComment #3
lexsoft00 commentedComment #4
paul_paris commentedHi Lexsoft,
I have used the patch and i get this error:
The website encountered an unexpected error. Please try again later.
Error: Class 'UserSession' not found in business_rules_cron() (line 463 of modules/contrib/business_rules/business_rules.module).
business_rules_cron()
call_user_func_array('business_rules_cron', Array) (Line: 392)
Drupal\Core\Extension\ModuleHandler->invoke('business_rules', 'cron') (Line: 236)
Drupal\Core\Cron->invokeCronHandlers() (Line: 134)
Drupal\Core\Cron->run() (Line: 75)
Drupal\Core\ProxyClass\Cron->run() (Line: 165)
Drupal\system\Form\CronForm->runCron(Array, Object)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 590)
Drupal\Core\Form\FormBuilder->processForm('system_cron_settings', Array, Object) (Line: 319)
Drupal\Core\Form\FormBuilder->buildForm('system_cron_settings', Object) (Line: 93)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 693)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Comment #5
lexsoft00 commentedTry now, forgot to add class:
use Drupal\Core\Session\UserSession;Comment #6
lexsoft00 commentedComment #7
lexsoft00 commentedComment #8
paul_paris commentedHi,
It 's ok no more error, but i can not understang exactilly what is the patch 's purpose.
Paul Paris
Comment #9
c.e.a commented@lexsoft This patch is not a bad idea at all, I have added to #3041221: List of all 'Bug reports' that need immediate support Assigned to: yseki for maintainer to have a look at.
Thank you for your great continuous support and help towards this module.
Comment #10
colanLogic looks good, but for coding standards: The first word should be capitalized, and each sentence should end with a ".".
Can we remove this?
Comment #11
lexsoft00 commentedHi @colan,
Thank you for taking the time to review this issue.
Please find a corrected patch.
I've added a checkbox to in Business Rule settings form to enable this functionality and also the ability to choose a user.
/admin/config/workflow/business_rules/settings
Comment #12
lexsoft00 commentedForgot to add
use Drupal\user\Entity\User;to the patch.Comment #13
lexsoft00 commentedComment #14
lexsoft00 commentedComment #15
lexsoft00 commentedComment #16
mlahde commentedAdding
use Drupal\user\Entity\User;to the patch once more. Otherwise it seemed to work fine.Changing back to Needs review or did you @lexsoft00 find something else to work with?
Comment #17
manish-31 commentedComment #18
manish-31 commentedUpdated last failed patch, needs review.
Comment #19
delacosta456 commentedhi
i am having this issue with BR 2.dev
Tested this patch but looks like it is not yet compatible with BR 2 or D9
Can somebody help for this ? is there any alternative ?
In views_rules it was possible to set the schedule to run as a specific user for this kind of situation. (just for info)
Thanks
## EDIT
i just tried path #16 which work well on BR 2.dev (D9.3)... don't know why patch #18 doesn't work
Comment #20
djween commentedSame... #16 applies but #18 doesn't apply when updating with composer. Patch in #16 worked for me.