sulu / suluautomationbundle Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I've only tested this for automations within SuluArticleBundle.
Server time: GMT+0
Admin (visitor) timezone: GMT+2
Create a new task and set time (for example 3:00 PM). Save it. In my case, since there are 2 hours difference between me and the server - I would expect that server will subtract 2 hours when saving. But it doesn't. It just saves as 2PM GMT+0.
Then, open the newly created task. You will notice that CMS is clever enough to add 2 hours (difference between visitor timezone and server timezone) to the time in field so it now appears as 4:00 PM (GMT+2). If you click save again without changing anything - CMS will save it as 4:00 PM GMT+0, not 4:00PM GMT+2.
So this is like a vicious cycle that adds/removes a few hours (+2 hours in my case) every time I click save without actually changing anything.
When saving a task, CMS should make adjustments to task time by taking into account difference between visitor/server timezones.
I would really like to release a stable version 2.0 (with Sulu 2.0 compatibility) of this bundle in the near future. Before we do that, we should have a look at the following things:
AutomationViewBuilder
to keep things consistent with the sulu core: sulu/sulu#6088 (comment)AutomationAdmin
ListMetadataLoader
+ rename list configurationAdmin is not loaded proprely. When SuluAutomationBundle is registered its main.js is not loaded due to wrong path:
An Exception was thrown while handling: No route found for "GET /ru/bundles/suluautomation/js/main.js"
(from "http://etp.reliz/admin/")
For webspace I set routes depending on localization:
<portals>
<portal>
<name>example.com</name>
<key>example</key>
<environments>
<environment type="prod">
<urls>
<url>{host}/{localization}</url>
</urls>
</environment>
<environment type="stage">
<urls>
<url>{host}/{localization}</url>
</urls>
</environment>
<environment type="dev">
<urls>
<url>{host}/{localization}</url>
</urls>
</environment>
</environments>
</portal>
</portals>
Q | A |
---|---|
Bug? | yes |
New Feature? | no |
Bundle Version | - |
Sulu Version | 2.2.x |
Attempted to load class "AutomationViewBuilder" from namespace "Sulu\Bundle\AutomationBundle\Admin\View".
Did you forget a "use" statement for another namespace?
Don't get an error
Install automation Bundle.
This issue was just created as a reference so it is better found by people running into the same issue if you get:
Attempted to load class "AutomationViewBuilder" from namespace "Sulu\Bundle\AutomationBundle\Admin\View".
Did you forget a "use" statement for another namespace?
It is a hint that you are using a early
version of the sulu/article-bundle
. Make sure you are upading the sulu/article-bundle
atleast to version 2.3.1
to be compatible with the ^2.0
release of sulu/automation-bundle
. Check also your other outdated sulu dependencies via composer outdated | grep sulu
and update them to the latest version where possible.
composer require sulu/article-bundle:^2.3.1
If you have custom code depending of the early version of the automation bundle see: https://github.com/sulu/SuluAutomationBundle/blob/2.0.0/UPGRADE.md
Q | A |
---|---|
Bug? | possible |
New Feature? | no |
Bundle Version | 2.0.2 (e75a862) |
Sulu Version | 2.3.7 (9c4e81d7c90fba211b8e2cc76b5393215c3ae17e) |
Browser Version | Firefox 100.0.1 (64-bit) |
After saving a page as a draft, I create an automation. When the automation has been executed, the page is published according to the activity log and I can see the changes on the website. The problem is that the 'Save' button is not disabled when I go to the page in Sulu, only when I clear the APCu cache by restarting the Sulu Docker container. The first two options in the dropdown of the 'Save' button are inactive, but the third one with the 'Publish' text, isn't.
I expect that the 'Save' button becomes disabled after a page has been published by an automation.
Described in Actual Behavior.
Q | A |
---|---|
Bug? | yes |
New Feature? | no |
Bundle Version | 2.1.2 |
Sulu Version | 2.6.3 |
PHP Version | 8.3.8 |
Browser Version | -- |
When attempting to add a new automation task (e.g., unpublish a page), a PHP type error occurs:
TypeError:
Sulu\Bundle\AdminBundle\Metadata\FormMetadata\FormMetadata::getSchema():
Return value must be of type Sulu\Bundle\AdminBundle\Metadata\SchemaMetadata\SchemaMetadata, null returned
at vendor/sulu/sulu/src/Sulu/Bundle/AdminBundle/Metadata/FormMetadata/FormMetadata.php:116
at Sulu\Bundle\AdminBundle\Metadata\FormMetadata\FormMetadata->getSchema()
(vendor/sulu/sulu/src/Sulu/Component/Content/Types/Metadata/GlobalBlocksTypedFormMetadataVisitor.php:108)
at Sulu\Component\Content\Types\Metadata\GlobalBlocksTypedFormMetadataVisitor->visitFormMetadata()
(vendor/sulu/sulu/src/Sulu/Bundle/AdminBundle/Metadata/FormMetadata/FormMetadataProvider.php:74)
at Sulu\Bundle\AdminBundle\Metadata\FormMetadata\FormMetadataProvider->getMetadata()
(vendor/sulu/sulu/src/Sulu/Bundle/AdminBundle/Controller/AdminController.php:197)
at Sulu\Bundle\AdminBundle\Controller\AdminController->metadataAction()
(vendor/symfony/http-kernel/HttpKernel.php:181)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
(vendor/symfony/http-kernel/HttpKernel.php:76)
at Symfony\Component\HttpKernel\HttpKernel->handle()
(vendor/symfony/http-kernel/Kernel.php:197)
at Symfony\Component\HttpKernel\Kernel->handle()
(public/index.php:69)
While debugging this, the FormMetadata::$schema
property is indeed null when the metadata for task_details
is retrieved. But this property can't be null: FormMetadata.php#L43-L44, FormMetadata.php#L43-L44.
It should be possible to add a task without the Sulu admin crashing.
sulu/skeleton
.You can also access the /admin/metadata/form/task_details?entityClass=Sulu\Bundle\PageBundle\Document\BasePageDocument
URI directly from the Sulu admin to trigger the error.
The source of the problem is in FormMetadataLoader
when the task_details
form metadata is built:
SuluAutomationBundle/Metadata/FormMetadataLoader.php
Lines 51 to 60 in 629e540
The $schema
property is never set to a valid object and that triggers a PHP type error. The now deprecated version of FormMetadata
allowed for this particular property to be null. So, this is probably just a holdover from that.
I'm not sure what the form's SchemaMetadata
is supposed to be set to. But since it doesn't appear to be set to anything in the existing code, perhaps simply initializing it to an empty object would suffice?
$form->setSchema(new SchemaMetadata());
This simple addition seems to fully resolve the issue for me.
Q | A |
---|---|
Bug? | yes |
New Feature? | no |
Bundle Version | b91b731 |
Sulu Version | 2.1.8 |
Browser Version | Browser name and version |
If the two tables ta_tasks and ta_task_executions are truncated via the database, there are still references left in the content that lead to a 500:
The identifier uuid is missing for a query of Task\TaskBundle\Entity\Task in vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php (line 315) in vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php :: missingIdentifierField (line 422) in vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php -> find (line 151) in vendor/php-task/task-bundle/src/Entity/TaskRepository.php -> find (line 37) in vendor/sulu/automation-bundle/Controller/TaskController.php -> findByUuid (line 179) in vendor/sulu/automation-bundle/Controller/TaskController.php -> extendResponseItem (line 143) in vendor/symfony/http-kernel/HttpKernel.php -> cgetAction (line 158) in vendor/symfony/http-kernel/HttpKernel.php -> handleRaw (line 80) in vendor/symfony/http-kernel/Kernel.php -> handle (line 201)
If the tables are empty and there are references in the content, this should not lead to an error.
Create a task for a specific content
Execute the task
Empty the two tables ta_tasks, ta_task_executions
Call the automation overview via the admin area for the specific content
try {
$task = $this->taskRepository->findByUuid($item['taskId']);
$executions = $this->taskExecutionRepository->findByTask($task);
if (0 < count($executions)) {
$item['status'] = $executions[0]->getStatus();
}
} catch (\Exception $exception) {
}
The AutomationBundle is a neat addition to Sulu allowing the user to manage the moment a page should be published or unpublished. However when a CMS gets more and more content users may want to set these actions through a bulk action.
It would be interesting to have a 'overview' page (same way as snippet-list) where the user can select pages through a list by using a checkbox, and then set a publish date on the selected pages all at once (bulk management).
In addition it could give users a better overview which pages are scheduled to be published at any given date. Is this something you guys would see somewhere in the future of this bundle? Or is this something that goes beyond your vision for this bundle?
Q | A |
---|---|
Bug? | no |
New Feature? | yes |
Bundle Version | develop |
Sulu Version | 2.0.3 |
So that it's translatable
Q | A |
---|---|
Bug? | yes |
New Feature? | no |
Bundle Version | 2.0-dev |
Sulu Version | 2.2.8 |
After installing and enabling the SuluAutomationBundle
in a Sulu 2.2 project, the following request is sent to the server when navigating from a page to a unlocalized view like the contact list:
http://demo.localhost:8001/admin/api/task/count?locale=undefined&entityId=undefined&entityClass=Sulu%5CBundle%5CPageBundle%5CDocument%5CBasePageDocument
This leads to the following error on the server:
{
"code":0,
"message":"Permission \"view\" in localization \"undefined\" for object with id \"\" and of type \"\" not granted",
"errors":[
"Symfony\\Component\\Security\\Core\\Exception\\AccessDeniedException: Permission \"view\" in localization \"undefined\" for object with id \"\" and of type \"\" not granted in \/Users\/niklas\/Development\/projects\/sulu-demo\/vendor\/sulu\/sulu\/src\/Sulu\/Component\/Security\/Authorization\/AbstractSecurityChecker.php:38\nStack trace:\n#0 \/Users\/niklas\/Development\/projects\/sulu-demo\/vendor\/sulu\/sulu\/src\/Sulu\/Bundle\/SecurityBundle\/EventListener\/SuluSecurityListener.php(106): Sulu\\Component\\Security\\Authorization\\AbstractSecurityChecker->checkPermission(Object(Sulu\\Component\\Security\\Authorization\\SecurityCondition), 'view')\n#1 \/Users\/niklas\/Development\/projects\/sulu-demo\/vendor\/symfony\/event-dispatcher\/Debug\/WrappedListener.php(117): Sulu\\Bundle\\SecurityBundle\\EventListener\\SuluSecurityListener->onKernelController(Object(Symfony\\Component\\HttpKernel\\Event\\ControllerEvent), 'kernel.controll...', Object(Symfony\\Component\\HttpKernel\\Debug\\TraceableEventDispatcher))\n#2 \/Users\/niklas\/Development\/projects\/sulu-demo\/vendor\/symfony\/event-dispatcher\/EventDispatcher.php(230): Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener->__invoke(Object(Symfony\\Component\\HttpKernel\\Event\\ControllerEvent), 'kernel.controll...', Object(Symfony\\Component\\HttpKernel\\Debug\\TraceableEventDispatcher))\n#3 \/Users\/niklas\/Development\/projects\/sulu-demo\/vendor\/symfony\/event-dispatcher\/EventDispatcher.php(59): Symfony\\Component\\EventDispatcher\\EventDispatcher->callListeners(Array, 'kernel.controll...', Object(Symfony\\Component\\HttpKernel\\Event\\ControllerEvent))\n#4 \/Users\/niklas\/Development\/projects\/sulu-demo\/vendor\/symfony\/event-dispatcher\/Debug\/TraceableEventDispatcher.php(151): Symfony\\Component\\EventDispatcher\\EventDispatcher->dispatch(Object(Symfony\\Component\\HttpKernel\\Event\\ControllerEvent), 'kernel.controll...')\n#5 \/Users\/niklas\/Development\/projects\/sulu-demo\/vendor\/symfony\/http-kernel\/HttpKernel.php(145): Symfony\\Component\\EventDispatcher\\Debug\\TraceableEventDispatcher->dispatch(Object(Symfony\\Component\\HttpKernel\\Event\\ControllerEvent), 'kernel.controll...')\n#6 \/Users\/niklas\/Development\/projects\/sulu-demo\/vendor\/symfony\/http-kernel\/HttpKernel.php(79): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)\n#7 \/Users\/niklas\/Development\/projects\/sulu-demo\/vendor\/symfony\/http-kernel\/Kernel.php(195): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#8 \/Users\/niklas\/Development\/projects\/sulu-demo\/public\/index.php(67): Symfony\\Component\\HttpKernel\\Kernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#9 {main}\n\nNext Symfony\\Component\\HttpKernel\\Exception\\AccessDeniedHttpException: Permission \"view\" in localization \"undefined\" for object with id \"\" and of type \"\" not granted in \/Users\/niklas\/Development\/projects\/sulu-demo\/vendor\/symfony\/security-http\/Firewall\/ExceptionListener.php:137\nStack trace:\n#0 \/Users\/niklas\/Development\/projects\/sulu-demo\/vendor\/symfony\/security-http\/Firewall\/ExceptionListener.php(102): Symfony\\Component\\Security\\Http\\Firewall\\ExceptionListener->handleAccessDeniedException(Object(Symfony\\Component\\HttpKernel\\Event\\ExceptionEvent), Object(Symfony\\Component\\Security\\Core\\Exception\\AccessDeniedException))\n#1 \/Users\/niklas\/Development\/projects\/sulu-demo\/vendor\/symfony\/event-dispatcher\/Debug\/WrappedListener.php(117): Symfony\\Component\\Security\\Http\\Firewall\\ExceptionListener->onKernelException(Object(Symfony\\Component\\HttpKernel\\Event\\ExceptionEvent), 'kernel.exceptio...', Object(Symfony\\Component\\HttpKernel\\Debug\\TraceableEventDispatcher))\n#2 \/Users\/niklas\/Development\/projects\/sulu-demo\/vendor\/symfony\/event-dispatcher\/EventDispatcher.php(230): Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener->__invoke(Object(Symfony\\Component\\HttpKernel\\Event\\ExceptionEvent), 'kernel.exceptio...', Object(Symfony\\Component\\HttpKernel\\Debug\\TraceableEventDispatcher))\n#3 \/Users\/niklas\/Development\/projects\/sulu-demo\/vendor\/symfony\/event-dispatcher\/EventDispatcher.php(59): Symfony\\Component\\EventDispatcher\\EventDispatcher->callListeners(Array, 'kernel.exceptio...', Object(Symfony\\Component\\HttpKernel\\Event\\ExceptionEvent))\n#4 \/Users\/niklas\/Development\/projects\/sulu-demo\/vendor\/symfony\/event-dispatcher\/Debug\/TraceableEventDispatcher.php(151): Symfony\\Component\\EventDispatcher\\EventDispatcher->dispatch(Object(Symfony\\Component\\HttpKernel\\Event\\ExceptionEvent), 'kernel.exceptio...')\n#5 \/Users\/niklas\/Development\/projects\/sulu-demo\/vendor\/symfony\/http-kernel\/HttpKernel.php(218): Symfony\\Component\\EventDispatcher\\Debug\\TraceableEventDispatcher->dispatch(Object(Symfony\\Component\\HttpKernel\\Event\\ExceptionEvent), 'kernel.exceptio...')\n#6 \/Users\/niklas\/Development\/projects\/sulu-demo\/vendor\/symfony\/http-kernel\/HttpKernel.php(90): Symfony\\Component\\HttpKernel\\HttpKernel->handleThrowable(Object(Symfony\\Component\\Security\\Core\\Exception\\AccessDeniedException), Object(Symfony\\Component\\HttpFoundation\\Request), 1)\n#7 \/Users\/niklas\/Development\/projects\/sulu-demo\/vendor\/symfony\/http-kernel\/Kernel.php(195): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#8 \/Users\/niklas\/Development\/projects\/sulu-demo\/public\/index.php(67): Symfony\\Component\\HttpKernel\\Kernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#9 {main}"
]
}
Switching from a page form to an unlocalized view should not lead to any errors on the server.
Q | A |
---|---|
Bug? | no |
New Feature? | yes |
Bundle Version | for 2.0 |
Sulu Version | 2.0 |
Browser Version | Browser name and version |
In Sulu 1.6 a number in the tab title was representing the currently active tasks. This feature is still missing.
The link to the documentation should be added to the README, once it is available: https://github.com/sulu/sulu-docs/tree/develop/bundles/automation
Do you have an example for implementing automation for a custom bundle?
The current documentation related to the bundle is only visible for Sulu version 1.6.
Thank you
The UrlHandler
uses request-host to clear the cache (see https://github.com/sulu/sulu/blob/develop/src/Sulu/Component/HttpCache/Handler/UrlHandler.php#L66). Therefor the DocumentPublishHandler
will be called inside a Command this URL will not be generated correctly (because no request is there).
There are three ways to fix it:
{host}
is used in prod (in sulu).Q | A |
---|---|
Bug? | no |
New Feature? | no |
Bundle Version | for 2.0 |
Sulu Version | 2.0 |
Browser Version | Browser name and version |
The information about the currently active task is missing.
If a task is active for a page, the save button should have a small information about the date and action of the currently active task.
When you have no permissions for the automationbundle an error occurs when open the page when it tries to add something to the header and an api request is done. It should avoid this when have no permissions for the bundle
Q | A |
---|---|
Bug? | no |
New Feature? | no |
Bundle Version | Specific version or SHA of a commit |
Sulu Version | 2.0 |
Browser Version | Browser name and version |
Currently AutomationTasks from the past are not disabled in the list and can still be edited.
Past tasks should be disabled and not editable.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.