Coder Social home page Coder Social logo

suluautomationbundle's Introduction


Sulu logo


GitHub license GitHub tag (latest SemVer) Test workflow status GitHub commit activity GitHub contributors Packagist downloads


Sulu is a highly extensible open-source PHP content management system based on the Symfony framework. Sulu is developed to deliver robust multi-lingual and multi-portal websites while providing an intuitive and extensible administration interface to manage the full content lifecycle.

Have a look at the official Sulu website for a comprehensive list of Sulu's features, core values and use cases.


Sulu Slideshow


This repository contains the core framework of the Sulu content management system. The framework implements the functionality that is built into the Sulu content management system and therefore is a dependency of all Sulu projects.

If you want to start a new Sulu project, you might be interested in the sulu/skeleton template repository. If you are planning to extend your existing Sulu project, visit the Sulu organization on GitHub for a complete list of official Sulu bundles.

๐Ÿš€ย  Installation and Documentation

The sulu/skeleton repository provides a pre-configured project template to quick-start your development. Visit the official Sulu documentation to find out how to use the project template for starting your own Sulu project.

โค๏ธย  Community and Contributions

The Sulu content management system is a community-driven open source project backed by various partner companies. We are committed to a fully transparent development process and highly appreciate any contributions. Whether you are helping us fixing bugs, proposing new feature, improving our documentation or spreading the word - we would love to have you as part of the Sulu community.

๐Ÿ“ซย  Have a question? Want to chat? Ran into a problem?

We are happy to welcome you in our official Slack channel or answer your questions via GitHub Discussions! Obviously you can always reach out to us directly via the Sulu twitter account or post your question on StackOverflow with the official sulu tag.

๐Ÿคย  Found a bug? Missing a specific feature?

Feel free to file a new issue with a respective title and description on the the sulu/sulu repository. If you already found a solution to your problem, we would love to review your pull request! Have a look at our contribution guidelines to find out about our coding standards.

โœ…ย  Requirements

Sulu requires a PHP version higher or equal to 8.2 and is compatible with every Symfony version starting from 5.4. Have a look at the require section in the composer.json of the sulu/sulu core framework to find an up-to-date list of the requirements of Sulu content management system.

๐Ÿ“˜ย  License

The Sulu content management system is released under the under terms of the MIT License.

suluautomationbundle's People

Contributors

alexander-schranz avatar danrot avatar edvinas9 avatar luca-rath avatar mamazu avatar mario-fehr avatar mark-gerarts avatar niklasnatter avatar prokyonn avatar wachterjohannes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

suluautomationbundle's Issues

No permissions throw an error on the page

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

Truncating ta_tasks and ta_task_executions leads to an error in the admin area

Q A
Bug? yes
New Feature? no
Bundle Version b91b731
Sulu Version 2.1.8
Browser Version Browser name and version

Actual Behavior

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)

Expected Behavior

If the tables are empty and there are references in the content, this should not lead to an error.

Steps to Reproduce

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

Possible Solutions

        try {
            $task = $this->taskRepository->findByUuid($item['taskId']);
            $executions = $this->taskExecutionRepository->findByTask($task);
            if (0 < count($executions)) {
                $item['status'] = $executions[0]->getStatus();
            }
        } catch (\Exception $exception) {
        }

Overview and bulk functionality

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?

Server error when navigating from page to contacts

Q A
Bug? yes
New Feature? no
Bundle Version 2.0-dev
Sulu Version 2.2.8

Actual Behavior

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}"
   ]
}

Expected Behavior

Switching from a page form to an unlocalized view should not lead to any errors on the server.

Steps to Reproduce

  1. Open the edit form of a page
  2. Navigate to an unlocalized view like the contact list

Missing Save-Button Task Information

Q A
Bug? no
New Feature? no
Bundle Version for 2.0
Sulu Version 2.0
Browser Version Browser name and version

Actual Behavior

The information about the currently active task is missing.

Expected Behavior

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.

Attempted to load class "AutomationViewBuilder" from namespace "Sulu\Bundle\AutomationBundle\Admin\View". Did you forget a "use" statement for another namespace?

Q A
Bug? yes
New Feature? no
Bundle Version -
Sulu Version 2.2.x

Actual Behavior

Attempted to load class "AutomationViewBuilder" from namespace "Sulu\Bundle\AutomationBundle\Admin\View".
Did you forget a "use" statement for another namespace?

Expected Behavior

Don't get an error

Steps to Reproduce

Install automation Bundle.

Possible Solutions

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

Number with active tasks

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.

Clearing cache when {host} is used in webspace.xml

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 DocumentPublishHandlerwill be called inside a Command this URL will not be generated correctly (because no request is there).

There are three ways to fix it:

SuluAutomationBundle 2.0 Roadmap

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:

  • Cleanup leftovers from the 1.6 Javascript setup (eg Gruntfile.js and package.json)
  • Check for code that is no longer used in version 2.0 like the TaskHandlerController and remove it
  • Adjust form to use a datetime picker instead of two separated pickers for date and time
  • Find a solution for #51
  • Implement a factory for the AutomationViewBuilder to keep things consistent with the sulu core: sulu/sulu#6088 (comment)
  • Check permissions in AutomationAdmin
  • Remove ListMetadataLoader + rename list configuration

Save button still active after page has been published by automation

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)

Actual Behavior

image

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.

Expected Behavior

I expect that the 'Save' button becomes disabled after a page has been published by an automation.

Steps to Reproduce

Described in Actual Behavior.

CMS doesn't take into account GMT timezone correctly when saving task time

Conditions

I've only tested this for automations within SuluArticleBundle.
Server time: GMT+0
Admin (visitor) timezone: GMT+2

Steps to reproduce

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.

Expected behaviour

When saving a task, CMS should make adjustments to task time by taking into account difference between visitor/server timezones.

Add translations to crowdin

Q A
Bug? no
New Feature? yes
Bundle Version develop
Sulu Version 2.0.3

Actual Behavior

So that it's translatable

Missing disabled state for past tasks in ListView

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

Actual Behavior

Currently AutomationTasks from the past are not disabled in the list and can still be edited.

Expected Behavior

Past tasks should be disabled and not editable.

SuluAutomationBundle's main.js is not loaded due to wrong path

Admin 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>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.