Giter VIP home page Giter VIP logo

collective.contentrules.setfield's Introduction

collective.contentrules.setfield's People

Contributors

djay avatar instification avatar jeffersonbledsoe avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

collective.contentrules.setfield's Issues

`zest.releaser` overwrites double-quotes in `setup.py`

Now that we are using black for formatting the code, most python files are using double quotes. However, zest.releaser seems to overwrite these quotes when updating the version number, and so this needs to be manually fixed each time we prepare a release. zest.releaser 6.22.1 fixes support for this when using __version__, however it's not trivial to have this attribute set as a single source. See PEP 396 and the single-sourcing package version number documentation for more info.

Add tests to collective.contentrules.setfield

Summary

Create tests for object modified, object parent modified and the "Preserve modification date" configuration

Requirements

  • Create framework for running tests
  • Create test for ensuring the content rule action is triggered when the triggering event is set to 'object modified'
  • Create test for ensuring the content rule action is triggered when the triggering event is set to 'object parents modified'
  • Create test for ensuring that when the "Preserve modification date" option is enabled, the setfield action does not alter the date of the affected object
  • Wire up travis

Problems Encountered

Importing content rules before object creation results in unwanted action triggering as object creation results in ObjectModifiedEvent being emitted. Content rules should be imported after content creation to alleviate this.

"update all content" doesn't make much sense

So triggering on one object always triggers for everything in the site? That seems really dangerous to me.
collective.contentrule.parentchild solves the case of updating children etc better and without having to reimplement all conditions.

AttributeError on create new site

Commit beb7822 introduces a bug in contentrules.setfield.handlers Line 19, where creating a new site throws an AttributeError before the site is successfully created.

Updating to the master branch's latest commit, 8edaedb does not solve the issue.

Steps to reproduce

  1. Setup buildout with this package installed
  2. Create a new Plone site
  3. Enter the site information and press "Create Plone Site"

Expected Result

The new Plone site is created and the welcome page appears

Current Result

A site error occurs with the following error:
Error Type: AttributeError
Error Value: getFolderContents

way to initialize values on rule save

If you change the code you might want to reset the site to ensure all the values are correct. One way to achieve this is a

[ ]   run against all matching content on next save

Which will reset to no again after it's saved.

The rule really has to run against all content, not using a query to bypass content. this is due to the way querysplitter works. or any other unknown condition from a plugin. You run the risk of having events specific to certain kinds of content though which then result in this being trigger on objects you don't expect.

If available should be done via async

this will have to only trigger in parts of the site where the rule is activated

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.