-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
4.1 robot #18
Merged
Merged
4.1 robot #18
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pbauer
added a commit
that referenced
this pull request
Nov 13, 2014
Branch: refs/heads/master Date: 2014-11-02T14:12:48+01:00 Author: Johannes Raggam (thet) <raggam-nl@adm.at> Commit: https://github.com/plone/plone.app.contenttypes/commit/880fc6f7d6517c7c575206367bed7f5ea0457e37 [#18] Add folderish content classes and FTI definitions for News Item, Document and Event Files changed: A plone/app/contenttypes/profiles/folderish/metadata.xml A plone/app/contenttypes/profiles/folderish/types.xml A plone/app/contenttypes/profiles/folderish/types/Document.xml A plone/app/contenttypes/profiles/folderish/types/Event.xml A plone/app/contenttypes/profiles/folderish/types/News_Item.xml M plone/app/contenttypes/content.py M plone/app/contenttypes/profiles.zcml diff --git a/plone/app/contenttypes/content.py b/plone/app/contenttypes/content.py index 5b8d4e5..dcd673f 100644 --- a/plone/app/contenttypes/content.py +++ b/plone/app/contenttypes/content.py @@ -95,3 +95,21 @@ class NewsItem(Item): class Event(Item): """Convinience subclass for ``File`` portal type """ + + +@implementer(IDocument) +class FolderishDocument(Container): + """Convinience subclass for ``File`` portal type + """ + + +@implementer(IEvent) +class FolderishEvent(Container): + """Convinience subclass for ``File`` portal type + """ + + +@implementer(INewsItem) +class FolderishNewsItem(Container): + """Convinience subclass for ``File`` portal type + """ diff --git a/plone/app/contenttypes/profiles.zcml b/plone/app/contenttypes/profiles.zcml index 886bd84..b2a315e 100644 --- a/plone/app/contenttypes/profiles.zcml +++ b/plone/app/contenttypes/profiles.zcml @@ -20,6 +20,16 @@ provides="Products.GenericSetup.interfaces.EXTENSION" /> + <!-- All types, News Item, Document and Event folderish, no sample content, + depends on default --> + <gs:registerProfile + name="folderish" + title="Plone default content-types (Folderish behavior) - dexterity" + directory="profiles/folderish" + description="This provides Plones default types without adding example comntent" + provides="Products.GenericSetup.interfaces.EXTENSION" + /> + <!-- Uninstall --> <gs:registerProfile name="uninstall" diff --git a/plone/app/contenttypes/profiles/folderish/metadata.xml b/plone/app/contenttypes/profiles/folderish/metadata.xml new file mode 100644 index 0000000..743d12c --- /dev/null +++ b/plone/app/contenttypes/profiles/folderish/metadata.xml @@ -0,0 +1,6 @@ +<metadata> + <version>1</version> + <dependencies> + <dependency>profile-plone.app.contenttypes:default</dependency> + </dependencies> +</metadata> diff --git a/plone/app/contenttypes/profiles/folderish/types.xml b/plone/app/contenttypes/profiles/folderish/types.xml new file mode 100644 index 0000000..34e8b69 --- /dev/null +++ b/plone/app/contenttypes/profiles/folderish/types.xml @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<object meta_type="Plone Types Tool" name="portal_types"> + <object meta_type="Dexterity FTI" name="Document" /> + <object meta_type="Dexterity FTI" name="News Item" /> + <object meta_type="Dexterity FTI" name="Event" /> +</object> diff --git a/plone/app/contenttypes/profiles/folderish/types/Document.xml b/plone/app/contenttypes/profiles/folderish/types/Document.xml new file mode 100644 index 0000000..6c997f2 --- /dev/null +++ b/plone/app/contenttypes/profiles/folderish/types/Document.xml @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<object name="Document" meta_type="Dexterity FTI" i18n:domain="plone" + xmlns:i18n="http://xml.zope.org/namespaces/i18n"> + <property name="filter_content_types">False</property> + <property name="klass">plone.app.contenttypes.content.FolderishDocument</property> +</object> diff --git a/plone/app/contenttypes/profiles/folderish/types/Event.xml b/plone/app/contenttypes/profiles/folderish/types/Event.xml new file mode 100644 index 0000000..710f9a9 --- /dev/null +++ b/plone/app/contenttypes/profiles/folderish/types/Event.xml @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<object name="Event" meta_type="Dexterity FTI" i18n:domain="plone" + xmlns:i18n="http://xml.zope.org/namespaces/i18n"> + <property name="filter_content_types">False</property> + <property name="klass">plone.app.contenttypes.content.FolderishEvent</property> +</object> diff --git a/plone/app/contenttypes/profiles/folderish/types/News_Item.xml b/plone/app/contenttypes/profiles/folderish/types/News_Item.xml new file mode 100644 index 0000000..c1a8a30 --- /dev/null +++ b/plone/app/contenttypes/profiles/folderish/types/News_Item.xml @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<object name="News Item" meta_type="Dexterity FTI" i18n:domain="plone" + xmlns:i18n="http://xml.zope.org/namespaces/i18n"> + <property name="filter_content_types">False</property> + <property name="klass">plone.app.contenttypes.content.FolderishNewsItem</property> +</object> Repository: plone.app.contenttypes Branch: refs/heads/master Date: 2014-11-02T14:13:02+01:00 Author: Bogdan Girman (bogdangi) <bogdan.girman@gmail.com> Commit: https://github.com/plone/plone.app.contenttypes/commit/f992fd215fcd7b6a4ea3592ad370ec42b6efe705 [#18] Add helpers to migrate object with changed base class Files changed: M plone/app/contenttypes/migration/browser.py M plone/app/contenttypes/migration/configure.zcml M plone/app/contenttypes/migration/dxmigration.py M plone/app/contenttypes/migration/vocabularies.py M plone/app/contenttypes/tests/test_migration.py diff --git a/plone/app/contenttypes/migration/browser.py b/plone/app/contenttypes/migration/browser.py index 1e94d1f..5d13741 100644 --- a/plone/app/contenttypes/migration/browser.py +++ b/plone/app/contenttypes/migration/browser.py @@ -10,6 +10,7 @@ from datetime import datetime from datetime import timedelta from plone.app.contenttypes.migration import migration +from plone.app.contenttypes.migration import dxmigration from plone.app.contenttypes.migration.utils import HAS_MULTILINGUAL from plone.app.contenttypes.migration.utils import installTypeIfNeeded from plone.app.contenttypes.migration.utils import isSchemaExtended @@ -362,6 +363,65 @@ def updateWidgets(self): ) +class IBaseClassMigratorForm(Interface): + + changed_base_classes = schema.List( + title=u'Changed base classes', + description=u'Select changed base classes you want to migrate', + value_type=schema.Choice( + vocabulary='plone.app.contenttypes.migration.changed_base_classes', + ), + required=True, + ) + + +class BaseClassMigratorForm(form.Form): + + fields = field.Fields(IBaseClassMigratorForm) + fields['changed_base_classes'].widgetFactory = CheckBoxFieldWidget + ignoreContext = True + enableCSRFProtection = True + + @button.buttonAndHandler(u'Update', name='update') + def handle_migrate(self, action): + data, errors = self.extractData() + + if errors: + return + + changed_base_classes = data.get('changed_base_classes', []) + if not changed_base_classes: + return + + catalog = getToolByName(self.context, "portal_catalog") + migrated = [] + not_migrated = [] + for brain in catalog(): + obj = brain.getObject() + old_class_name = dxmigration.get_old_class_name_string(obj) + if old_class_name in changed_base_classes: + if dxmigration.migrate_base_class_to_new_class(obj): + migrated.append(obj) + else: + not_migrated.append(obj) + + messages = IStatusMessage(self.request) + info_message_template = 'There are {0} objects migrated.' + warn_message_template = 'There are not {0} objects migrated.' + if migrated: + msg = info_message_template.format(len(migrated)) + messages.addStatusMessage(msg, type='info') + if not_migrated: + msg = warn_message_template.format(len(not_migrated)) + messages.addStatusMessage(msg, type='warn') + self.request.response.redirect(self.request['ACTUAL_URL']) + + +BaseClassMigrator = wrap_form( + BaseClassMigratorForm, +) + + class ATCTMigratorHelpers(BrowserView): def objects_to_be_migrated(self): diff --git a/plone/app/contenttypes/migration/configure.zcml b/plone/app/contenttypes/migration/configure.zcml index e912337..9881860 100644 --- a/plone/app/contenttypes/migration/configure.zcml +++ b/plone/app/contenttypes/migration/configure.zcml @@ -36,6 +36,14 @@ /> <browser:page + name="base_class_migrator_form" + for="Products.CMFPlone.interfaces.IPloneSiteRoot" + class=".browser.BaseClassMigrator" + layer="plone.app.contenttypes.interfaces.IPloneAppContenttypesLayer" + permission="cmf.ManagePortal" + /> + + <browser:page name="atct_migrator_helpers" for="Products.CMFPlone.interfaces.IPloneSiteRoot" class=".browser.ATCTMigratorHelpers" @@ -69,6 +77,11 @@ name="plone.app.contenttypes.migration.extendedtypes" provides="zope.schema.interfaces.IVocabularyFactory" /> + <utility + factory=".vocabularies.ChangedBaseClasses" + name="plone.app.contenttypes.migration.changed_base_classes" + provides="zope.schema.interfaces.IVocabularyFactory" /> + <adapter name="nullmigrator" factory=".migration.BaseCustomMigator"/> </configure> diff --git a/plone/app/contenttypes/migration/dxmigration.py b/plone/app/contenttypes/migration/dxmigration.py index b5ce49a..09d1a0b 100644 --- a/plone/app/contenttypes/migration/dxmigration.py +++ b/plone/app/contenttypes/migration/dxmigration.py @@ -1,11 +1,16 @@ # -*- coding: utf-8 -*- +from Products.BTreeFolder2.BTreeFolder2 import BTreeFolder2Base +from Products.CMFCore.utils import getToolByName from Products.contentmigration.basemigrator.migrator import CMFItemMigrator from Products.contentmigration.basemigrator.walker import CatalogWalker from plone.app.contenttypes.interfaces import IEvent from plone.app.contenttypes.migration import datetime_fixer +from plone.dexterity.content import Container +from plone.dexterity.content import Item from plone.event.utils import default_timezone from zope.annotation.interfaces import IAnnotations from zope.component.hooks import getSite +import importlib def migrate(portal, migrator): @@ -100,3 +105,80 @@ def migrate_schema_fields(self): old_text = annotations.get( 'plone.app.event.dx.behaviors.IEventSummary.text', None) self.new.text = old_text + + +def get_old_class_name_string(obj): + """Returns old class name string.""" + return '{0}.{1}'.format(obj.__module__, obj.__class__.__name__) + + +def get_portal_type_name_string(obj): + portal = getSite() + types = getToolByName(portal, "portal_types") + portal_type = types.get(obj.portal_type) + if not portal_type: + return + + return portal_type.klass + + +def migrate_base_class_to_new_class(obj, + indexes=[ + 'is_folderish', + 'object_provides', + ], + ): + new_class_name = get_portal_type_name_string(obj) + current_class_name = get_old_class_name_string(obj) + + if new_class_name == current_class_name: + return False + + was_item = isinstance(obj, Item) + obj_id = obj.getId() + module_name, class_name = new_class_name.rsplit('.', 1) + module = importlib.import_module(module_name) + new_class = getattr(module, class_name) + + # update obj class + parent = obj.__parent__ + parent._delOb(obj_id) + obj.__class__ = new_class + parent._setOb(obj_id, obj) + + is_container = isinstance(obj, Container) + + # If object was Item likesh and becomes Containerish we have to do few + # preparation + if was_item and is_container: + # update obj _tree, because now it is container + BTreeFolder2Base._initBTrees(obj) + + # reindex + obj.reindexObject(indexes) + + return True + + +def list_of_objects_with_changed_base_class(): + portal = getSite() + + catalog = getToolByName(portal, "portal_catalog") + + for brain in catalog(): + obj = brain.getObject() + if get_portal_type_name_string(obj) != get_old_class_name_string(obj): + yield obj + + +def list_of_changed_base_class_names(): + """Returns list of class names that are not longer in portal_types.""" + changed_base_class_names = {} + for obj in list_of_objects_with_changed_base_class(): + changed_base_class_name = get_old_class_name_string(obj) + if changed_base_class_name not in changed_base_class_names: + number_objects = changed_base_class_names.get( + changed_base_class_name, 0) + changed_base_class_names[changed_base_class_name] = \ + number_objects + 1 + return changed_base_class_names diff --git a/plone/app/contenttypes/migration/vocabularies.py b/plone/app/contenttypes/migration/vocabularies.py index 8f46aa5..f6d710c 100644 --- a/plone/app/contenttypes/migration/vocabularies.py +++ b/plone/app/contenttypes/migration/vocabularies.py @@ -204,3 +204,19 @@ def __call__(self, context): extended fields. """ return results(context, show_extended=True) + + +class ChangedBaseClasses(object): + implements(IVocabularyFactory) + + def __call__(self, context): + """Return a vocabulary with all changed base classes.""" + from plone.app.contenttypes.migration.dxmigration import \ + list_of_changed_base_class_names + list_of_class_names = list_of_changed_base_class_names() or {} + return SimpleVocabulary( + [SimpleVocabulary.createTerm( + class_name, class_name, + '{0} ({1})'.format(class_name, list_of_class_names[class_name])) + for class_name in list_of_class_names.keys()] + ) diff --git a/plone/app/contenttypes/tests/test_migration.py b/plone/app/contenttypes/tests/test_migration.py index 76e1ff8..ab3823a 100644 --- a/plone/app/contenttypes/tests/test_migration.py +++ b/plone/app/contenttypes/tests/test_migration.py @@ -2,12 +2,19 @@ from Products.CMFCore.utils import getToolByName from five.intid.intid import IntIds from five.intid.site import addUtility +from lxml import etree +from plone.app.contenttypes.testing import \ + PLONE_APP_CONTENTTYPES_FUNCTIONAL_TESTING from plone.app.contenttypes.testing import \ PLONE_APP_CONTENTTYPES_MIGRATION_TESTING from plone.app.contenttypes.testing import set_browserlayer +from plone.app.testing import SITE_OWNER_NAME +from plone.app.testing import SITE_OWNER_PASSWORD from plone.app.testing import applyProfile from plone.app.testing import login +from plone.dexterity.content import Container from plone.event.interfaces import IEventAccessor +from plone.testing.z2 import Browser from zope.annotation.interfaces import IAnnotations from zope.component import getMultiAdapter from zope.component import getSiteManager @@ -1280,3 +1287,125 @@ def test_migration_view_confirmation(self): ) results = migration_view() self.assertIn('@@migrate_from_atct?migrate=1', results) + + +class MigrateDexterityBaseClassIntegrationTest(unittest.TestCase): + + layer = PLONE_APP_CONTENTTYPES_MIGRATION_TESTING + + def setUp(self): + self.portal = self.layer['portal'] + + applyProfile(self.portal, 'plone.app.dexterity:testing') + + self.portal.acl_users.userFolderAddUser('admin', + 'secret', + ['Manager'], + []) + login(self.portal, 'admin') + + # Add default content + self.portal.invokeFactory('Document', 'item') + + # Change Document conent type to folderish + portal_types = getToolByName(self.portal, 'portal_types') + portal_types['Document'].klass = 'plone.dexterity.content.Container' + portal_types['Document'].allowed_content_types = ('Document',) + + def test_dxmigration_migrate_item_to_container_class_is_changed(self): + """Check that base class was changed.""" + from plone.app.contenttypes.migration.dxmigration import \ + migrate_base_class_to_new_class + migrate_base_class_to_new_class(self.portal.item) + self.assertTrue(isinstance(self.portal.item, Container)) + + def test_dxmigration_migrate_item_to_container_add_object_inside(self): + """Check that after migrate base class it can add items inside object. + """ + from plone.app.contenttypes.migration.dxmigration import \ + migrate_base_class_to_new_class + migrate_base_class_to_new_class(self.portal.item) + self.portal.item.invokeFactory('Document', 'doc') + self.assertEqual(len(self.portal.item.folderlistingFolderContents()), 1) + + def test_dxmigration_migrate_list_of_objects_with_changed_base_class(self): + """Check list of objects with changed classes.""" + from plone.app.contenttypes.migration.dxmigration import \ + list_of_objects_with_changed_base_class + # We have already one changed object + objects = [i for i in list_of_objects_with_changed_base_class()] + self.assertEqual(len(objects), 1) + + def test_dxmigration_migrate_list_of_changed_base_class_names(self): + """Check list of changed base class names.""" + from plone.app.contenttypes.migration.dxmigration import \ + list_of_changed_base_class_names + # We have already one changed object + names = [i for i in list_of_changed_base_class_names()] + self.assertEqual(len(names), 1) + + def test_dxmigration_migrate_vocabulary_changed_base_classes(self): + """Check vocabulary of changed base class names.""" + # We have already one changed object + name = 'plone.app.contenttypes.migration.changed_base_classes' + factory = getUtility(IVocabularyFactory, name) + vocabulary = factory(self.portal) + self.assertEqual(len(vocabulary), 1) + + +class MigrateDexterityBaseClassFunctionalTest(unittest.TestCase): + + layer = PLONE_APP_CONTENTTYPES_FUNCTIONAL_TESTING + + def setUp(self): + app = self.layer['app'] + self.portal = self.layer['portal'] + self.request = self.layer['request'] + + self.portal_url = self.portal.absolute_url() + self.manage_document_url = '{0}/{1}/{2}/{3}'.format( + self.portal_url, + 'portal_types', + 'Document', + 'manage_propertiesForm', + ) + + self.browser = Browser(app) + self.browser.handleErrors = False + self.browser.addHeader( + 'Authorization', + 'Basic %s:%s' % (SITE_OWNER_NAME, SITE_OWNER_PASSWORD,) + ) + + # Add default content + self.browser.open(self.portal_url) + self.browser.getLink('Page').click() + self.browser.getControl(name='form.widgets.IDublinCore.title')\ + .value = "My item" + self.browser.getControl(name='form.widgets.IShortName.id')\ + .value = "item" + self.browser.getControl('Save').click() + + # Change Document conent type to folderish + self.browser.open(self.manage_document_url) + self.browser.getControl(name='klass:string') \ + .value = 'plone.app.contenttypes.content.Collection' + self.browser.getControl('Save Changes').click() + self.browser.open( + '{0}/@@base_class_migrator_form'.format(self.portal_url)) + self.good_info_message_template = 'There are {0} objects migrated.' + + def test_dxmigration_migrate_check_migration_form_view(self): + """Check base class migrator view of changed base class names.""" + html = etree.HTML(self.browser.contents) + checkboxes = html.xpath('//form//*[@name="{0}"]'.format( + 'form.widgets.changed_base_classes:list')) + self.assertEqual(len(checkboxes), 1) + + def test_dxmigration_migrate_check_migration_successful_message(self): + """Check base class migrator view of changed base class names.""" + self.browser.getControl(name='form.widgets.changed_base_classes:list') \ + .value = ['true'] + self.browser.getControl('Update').click() + self.assertIn( + self.good_info_message_template.format(1), self.browser.contents) Repository: plone.app.contenttypes Branch: refs/heads/master Date: 2014-11-02T15:13:32+01:00 Author: Bogdan Girman (bogdangi) <bogdan.girman@gmail.com> Commit: https://github.com/plone/plone.app.contenttypes/commit/c906880b28aeeb420a86e4180290e247782a9058 [#18] Add documentation to migrate all to folderish content type Files changed: M docs/README.rst diff --git a/docs/README.rst b/docs/README.rst index 240807e..a4fb850 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -218,6 +218,36 @@ Future versions of plone.app.contenttypes will have with a form that allows you However if you'd like to migrate your content-types to Dexterity before this feature is completed you might want to have a look at the code of plone.app.contenttypes.migration.migration.NewsItemMigrator as a blueprint for a migration. +Migrating non folderish to folderish objects (or change base class for any dexterety base type) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Migration non folderish object to folderish has few steps. + +Step 1 (Update base content types folderish) +------------------------------------------- + +Apply `folderish` profile. + +- Go to portal_setup->Import; + +- Select `Plone default content-types (Folderish behavior) - dexterity` + +- Click `Import all steps` + + +Step 2 (Update base class for exist objects) +-------------------------------------------- + +There is update changed base class migration step which allow you to update base class if last one was changed. + +To get this migration form you have to open follow link `PORTAL_URL/@@base_class_migrator_form`. + +On this view you will see check boxes with class name string and numbers of changed objects that are going to be updated. +Select classes that you want to update and click on button `Update`. + +If migration was successful you see the info box with number of successfully updated objects or warning with number of not updated objects. + + Widgets ------- Repository: plone.app.contenttypes Branch: refs/heads/master Date: 2014-11-07T11:31:31+01:00 Author: Philip Bauer (pbauer) <bauer@starzel.de> Commit: https://github.com/plone/plone.app.contenttypes/commit/54f20c5e13228f46ec8b10c3b2a906c4ed8ab8cf allow folderish collections Files changed: A plone/app/contenttypes/profiles/folderish/types/Collection.xml M plone/app/contenttypes/content.py M plone/app/contenttypes/profiles/folderish/types.xml diff --git a/plone/app/contenttypes/content.py b/plone/app/contenttypes/content.py index dcd673f..07b366d 100644 --- a/plone/app/contenttypes/content.py +++ b/plone/app/contenttypes/content.py @@ -14,6 +14,8 @@ @implementer(ICollection) class Collection(Item): + """Convinience Item subclass for ``Collection`` portal type + """ # BBB def listMetaDataFields(self, exclude=True): @@ -69,47 +71,54 @@ class File(Item): @implementer(IFolder) class Folder(Container): - """Convinience subclass for ``File`` portal type + """Convinience subclass for ``Folder`` portal type """ @implementer(IImage) class Image(Item): - """Convinience subclass for ``File`` portal type + """Convinience subclass for ``Image`` portal type """ @implementer(ILink) class Link(Item): - """Convinience subclass for ``File`` portal type + """Convinience subclass for ``Link`` portal type """ @implementer(INewsItem) class NewsItem(Item): - """Convinience subclass for ``File`` portal type + """Convinience subclass for ``News Item`` portal type """ @implementer(IEvent) class Event(Item): - """Convinience subclass for ``File`` portal type + """Convinience subclass for ``Event`` portal type + """ + +# Folderish subclasses used by 'profile-plone.app.contenttypes:folderish' + +@implementer(ICollection) +class FolderishCollection(Container): + """Folderish convinience subclass for ``Collection`` portal type """ @implementer(IDocument) class FolderishDocument(Container): - """Convinience subclass for ``File`` portal type + """Folderish convinience subclass for ``Document`` portal type """ @implementer(IEvent) class FolderishEvent(Container): - """Convinience subclass for ``File`` portal type + """Folderish convinience subclass for ``Event`` portal type """ @implementer(INewsItem) class FolderishNewsItem(Container): - """Convinience subclass for ``File`` portal type + """Folderish convinience subclass for ``News Item`` portal type """ diff --git a/plone/app/contenttypes/profiles/folderish/types.xml b/plone/app/contenttypes/profiles/folderish/types.xml index 34e8b69..740c1e8 100644 --- a/plone/app/contenttypes/profiles/folderish/types.xml +++ b/plone/app/contenttypes/profiles/folderish/types.xml @@ -1,5 +1,6 @@ <?xml version="1.0"?> <object meta_type="Plone Types Tool" name="portal_types"> + <object meta_type="Dexterity FTI" name="Collection" /> <object meta_type="Dexterity FTI" name="Document" /> <object meta_type="Dexterity FTI" name="News Item" /> <object meta_type="Dexterity FTI" name="Event" /> diff --git a/plone/app/contenttypes/profiles/folderish/types/Collection.xml b/plone/app/contenttypes/profiles/folderish/types/Collection.xml new file mode 100644 index 0000000..a396a48 --- /dev/null +++ b/plone/app/contenttypes/profiles/folderish/types/Collection.xml @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<object name="Collection" meta_type="Dexterity FTI" i18n:domain="plone" + xmlns:i18n="http://xml.zope.org/namespaces/i18n"> + <property name="filter_content_types">False</property> + <property name="klass">plone.app.contenttypes.content.FolderishCollection</property> +</object> Repository: plone.app.contenttypes Branch: refs/heads/master Date: 2014-11-07T11:31:42+01:00 Author: Philip Bauer (pbauer) <bauer@starzel.de> Commit: https://github.com/plone/plone.app.contenttypes/commit/627de331e528ed5a5b2278348676e6f485890291 update documentation Files changed: M docs/README.rst diff --git a/docs/README.rst b/docs/README.rst index a4fb850..b2ea4ab 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -218,35 +218,27 @@ Future versions of plone.app.contenttypes will have with a form that allows you However if you'd like to migrate your content-types to Dexterity before this feature is completed you might want to have a look at the code of plone.app.contenttypes.migration.migration.NewsItemMigrator as a blueprint for a migration. -Migrating non folderish to folderish objects (or change base class for any dexterety base type) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Migrating to folderish objects or change base class for any dexterity type +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Migration non folderish object to folderish has few steps. -Step 1 (Update base content types folderish) -------------------------------------------- - -Apply `folderish` profile. - -- Go to portal_setup->Import; +Step 1: Enable folderish types +++++++++++++++++++++++++++++++ -- Select `Plone default content-types (Folderish behavior) - dexterity` - -- Click `Import all steps` +See `Using folderish types`_ -Step 2 (Update base class for exist objects) --------------------------------------------- +Step 2: Update base class for existing objects +++++++++++++++++++++++++++++++++++++++++++++++ -There is update changed base class migration step which allow you to update base class if last one was changed. +If you changed the base-class of existing types you might also want to upgrade the base-class of existing objects. You can use the following form for this: `PORTAL_URL/@@base_class_migrator_form`. -To get this migration form you have to open follow link `PORTAL_URL/@@base_class_migrator_form`. +On this you will see checkboxes with class names and the amount of objects that are going to be updated. Select classes that you want to update and click on button `Update`. -On this view you will see check boxes with class name string and numbers of changed objects that are going to be updated. -Select classes that you want to update and click on button `Update`. - -If migration was successful you see the info box with number of successfully updated objects or warning with number of not updated objects. +If the migration was successful you see the info box with number of successfully updated objects or a warning with number of not updated objects. +This form can be used to change the base-class of any dexterity-types instances. Widgets ------- @@ -323,6 +315,29 @@ If you want to add plone.app.contenttypes as a dependency from another products If you use the profile ``default`` then the default-content in new sites will still be Archetypes-based. You'll then have to migrate that content using the migration-form ``@@atct_migrator`` or delete it by hand. +Using folderish types +^^^^^^^^^^^^^^^^^^^^^ + +If you want all types folderish you need to depend on the profile ``folderish`` in your own ``metadata.xml``. + +.. code:: xml + + <metadata> + <version>1</version> + <dependencies> + <dependency>profile-plone.app.contenttypes:folderish</dependency> + </dependencies> + </metadata> + +You can also enable this profile by hand by applying the `folderish` profile: + +- Go to portal_setup->Import; +- Select `Plone default content-types (Folderish behavior) - dexterity` +- Click `Import all steps` + +You can also migrate your existing objects to folderish types. For details see `Step 2: Update base class for existing objects`_ + + Extending the types ^^^^^^^^^^^^^^^^^^^ Repository: plone.app.contenttypes Branch: refs/heads/master Date: 2014-11-07T11:33:15+01:00 Author: Johannes Raggam (thet) <raggam-nl@adm.at> Commit: https://github.com/plone/plone.app.contenttypes/commit/acfb8a1db1463c11b56d990ecafb6196f458147e [#18] Add folderish content classes and FTI definitions for News Item, Document and Event Files changed: A plone/app/contenttypes/profiles/folderish/metadata.xml A plone/app/contenttypes/profiles/folderish/types.xml A plone/app/contenttypes/profiles/folderish/types/Document.xml A plone/app/contenttypes/profiles/folderish/types/Event.xml A plone/app/contenttypes/profiles/folderish/types/News_Item.xml M plone/app/contenttypes/content.py M plone/app/contenttypes/profiles.zcml diff --git a/plone/app/contenttypes/content.py b/plone/app/contenttypes/content.py index 5b8d4e5..dcd673f 100644 --- a/plone/app/contenttypes/content.py +++ b/plone/app/contenttypes/content.py @@ -95,3 +95,21 @@ class NewsItem(Item): class Event(Item): """Convinience subclass for ``File`` portal type """ + + +@implementer(IDocument) +class FolderishDocument(Container): + """Convinience subclass for ``File`` portal type + """ + + +@implementer(IEvent) +class FolderishEvent(Container): + """Convinience subclass for ``File`` portal type + """ + + +@implementer(INewsItem) +class FolderishNewsItem(Container): + """Convinience subclass for ``File`` portal type + """ diff --git a/plone/app/contenttypes/profiles.zcml b/plone/app/contenttypes/profiles.zcml index 886bd84..b2a315e 100644 --- a/plone/app/contenttypes/profiles.zcml +++ b/plone/app/contenttypes/profiles.zcml @@ -20,6 +20,16 @@ provides="Products.GenericSetup.interfaces.EXTENSION" /> + <!-- All types, News Item, Document and Event folderish, no sample content, + depends on default --> + <gs:registerProfile + name="folderish" + title="Plone default content-types (Folderish behavior) - dexterity" + directory="profiles/folderish" + description="This provides Plones default types without adding example comntent" + provides="Products.GenericSetup.interfaces.EXTENSION" + /> + <!-- Uninstall --> <gs:registerProfile name="uninstall" diff --git a/plone/app/contenttypes/profiles/folderish/metadata.xml b/plone/app/contenttypes/profiles/folderish/metadata.xml new file mode 100644 index 0000000..743d12c --- /dev/null +++ b/plone/app/contenttypes/profiles/folderish/metadata.xml @@ -0,0 +1,6 @@ +<metadata> + <version>1</version> + <dependencies> + <dependency>profile-plone.app.contenttypes:default</dependency> + </dependencies> +</metadata> diff --git a/plone/app/contenttypes/profiles/folderish/types.xml b/plone/app/contenttypes/profiles/folderish/types.xml new file mode 100644 index 0000000..34e8b69 --- /dev/null +++ b/plone/app/contenttypes/profiles/folderish/types.xml @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<object meta_type="Plone Types Tool" name="portal_types"> + <object meta_type="Dexterity FTI" name="Document" /> + <object meta_type="Dexterity FTI" name="News Item" /> + <object meta_type="Dexterity FTI" name="Event" /> +</object> diff --git a/plone/app/contenttypes/profiles/folderish/types/Document.xml b/plone/app/contenttypes/profiles/folderish/types/Document.xml new file mode 100644 index 0000000..6c997f2 --- /dev/null +++ b/plone/app/contenttypes/profiles/folderish/types/Document.xml @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<object name="Document" meta_type="Dexterity FTI" i18n:domain="plone" + xmlns:i18n="http://xml.zope.org/namespaces/i18n"> + <property name="filter_content_types">False</property> + <property name="klass">plone.app.contenttypes.content.FolderishDocument</property> +</object> diff --git a/plone/app/contenttypes/profiles/folderish/types/Event.xml b/plone/app/contenttypes/profiles/folderish/types/Event.xml new file mode 100644 index 0000000..710f9a9 --- /dev/null +++ b/plone/app/contenttypes/profiles/folderish/types/Event.xml @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<object name="Event" meta_type="Dexterity FTI" i18n:domain="plone" + xmlns:i18n="http://xml.zope.org/namespaces/i18n"> + <property name="filter_content_types">False</property> + <property name="klass">plone.app.contenttypes.content.FolderishEvent</property> +</object> diff --git a/plone/app/contenttypes/profiles/folderish/types/News_Item.xml b/plone/app/contenttypes/profiles/folderish/types/News_Item.xml new file mode 100644 index 0000000..c1a8a30 --- /dev/null +++ b/plone/app/contenttypes/profiles/folderish/types/News_Item.xml @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<object name="News Item" meta_type="Dexterity FTI" i18n:domain="plone" + xmlns:i18n="http://xml.zope.org/namespaces/i18n"> + <property name="filter_content_types">False</property> + <property name="klass">plone.app.contenttypes.content.FolderishNewsItem</property> +</object> Repository: plone.app.contenttypes Branch: refs/heads/master Date: 2014-11-07T11:34:39+01:00 Author: Bogdan Girman (bogdangi) <bogdan.girman@gmail.com> Commit: https://github.com/plone/plone.app.contenttypes/commit/2d8c5fe6ebe79f9d49b1da0a469c1cc2d554b46c [#18] Add helpers to migrate object with changed base class Files changed: M plone/app/contenttypes/migration/browser.py M plone/app/contenttypes/migration/configure.zcml M plone/app/contenttypes/migration/dxmigration.py M plone/app/contenttypes/migration/vocabularies.py M plone/app/contenttypes/tests/test_migration.py diff --git a/plone/app/contenttypes/migration/browser.py b/plone/app/contenttypes/migration/browser.py index 841b6d3..112481f 100644 --- a/plone/app/contenttypes/migration/browser.py +++ b/plone/app/contenttypes/migration/browser.py @@ -10,6 +10,7 @@ from datetime import datetime from datetime import timedelta from plone.app.contenttypes.migration import migration +from plone.app.contenttypes.migration import dxmigration from plone.app.contenttypes.migration.utils import HAS_MULTILINGUAL from plone.app.contenttypes.migration.utils import installTypeIfNeeded from plone.app.contenttypes.migration.utils import isSchemaExtended @@ -362,6 +363,65 @@ def updateWidgets(self): ) +class IBaseClassMigratorForm(Interface): + + changed_base_classes = schema.List( + title=u'Changed base classes', + description=u'Select changed base classes you want to migrate', + value_type=schema.Choice( + vocabulary='plone.app.contenttypes.migration.changed_base_classes', + ), + required=True, + ) + + +class BaseClassMigratorForm(form.Form): + + fields = field.Fields(IBaseClassMigratorForm) + fields['changed_base_classes'].widgetFactory = CheckBoxFieldWidget + ignoreContext = True + enableCSRFProtection = True + + @button.buttonAndHandler(u'Update', name='update') + def handle_migrate(self, action): + data, errors = self.extractData() + + if errors: + return + + changed_base_classes = data.get('changed_base_classes', []) + if not changed_base_classes: + return + + catalog = getToolByName(self.context, "portal_catalog") + migrated = [] + not_migrated = [] + for brain in catalog(): + obj = brain.getObject() + old_class_name = dxmigration.get_old_class_name_string(obj) + if old_class_name in changed_base_classes: + if dxmigration.migrate_base_class_to_new_class(obj): + migrated.append(obj) + else: + not_migrated.append(obj) + + messages = IStatusMessage(self.request) + info_message_template = 'There are {0} objects migrated.' + warn_message_template = 'There are not {0} objects migrated.' + if migrated: + msg = info_message_template.format(len(migrated)) + messages.addStatusMessage(msg, type='info') + if not_migrated: + msg = warn_message_template.format(len(not_migrated)) + messages.addStatusMessage(msg, type='warn') + self.request.response.redirect(self.request['ACTUAL_URL']) + + +BaseClassMigrator = wrap_form( + BaseClassMigratorForm, +) + + class ATCTMigratorHelpers(BrowserView): def objects_to_be_migrated(self): diff --git a/plone/app/contenttypes/migration/configure.zcml b/plone/app/contenttypes/migration/configure.zcml index e912337..9881860 100644 --- a/plone/app/contenttypes/migration/configure.zcml +++ b/plone/app/contenttypes/migration/configure.zcml @@ -36,6 +36,14 @@ /> <browser:page + name="base_class_migrator_form" + for="Products.CMFPlone.interfaces.IPloneSiteRoot" + class=".browser.BaseClassMigrator" + layer="plone.app.contenttypes.interfaces.IPloneAppContenttypesLayer" + permission="cmf.ManagePortal" + /> + + <browser:page name="atct_migrator_helpers" for="Products.CMFPlone.interfaces.IPloneSiteRoot" class=".browser.ATCTMigratorHelpers" @@ -69,6 +77,11 @@ name="plone.app.contenttypes.migration.extendedtypes" provides="zope.schema.interfaces.IVocabularyFactory" /> + <utility + factory=".vocabularies.ChangedBaseClasses" + name="plone.app.contenttypes.migration.changed_base_classes" + provides="zope.schema.interfaces.IVocabularyFactory" /> + <adapter name="nullmigrator" factory=".migration.BaseCustomMigator"/> </configure> diff --git a/plone/app/contenttypes/migration/dxmigration.py b/plone/app/contenttypes/migration/dxmigration.py index b5ce49a..09d1a0b 100644 --- a/plone/app/contenttypes/migration/dxmigration.py +++ b/plone/app/contenttypes/migration/dxmigration.py @@ -1,11 +1,16 @@ # -*- coding: utf-8 -*- +from Products.BTreeFolder2.BTreeFolder2 import BTreeFolder2Base +from Products.CMFCore.utils import getToolByName from Products.contentmigration.basemigrator.migrator import CMFItemMigrator from Products.contentmigration.basemigrator.walker import CatalogWalker from plone.app.contenttypes.interfaces import IEvent from plone.app.contenttypes.migration import datetime_fixer +from plone.dexterity.content import Container +from plone.dexterity.content import Item from plone.event.utils import default_timezone from zope.annotation.interfaces import IAnnotations from zope.component.hooks import getSite +import importlib def migrate(portal, migrator): @@ -100,3 +105,80 @@ def migrate_schema_fields(self): old_text = annotations.get( 'plone.app.event.dx.behaviors.IEventSummary.text', None) self.new.text = old_text + + +def get_old_class_name_string(obj): + """Returns old class name string.""" + return '{0}.{1}'.format(obj.__module__, obj.__class__.__name__) + + +def get_portal_type_name_string(obj): + portal = getSite() + types = getToolByName(portal, "portal_types") + portal_type = types.get(obj.portal_type) + if not portal_type: + return + + return portal_type.klass + + +def migrate_base_class_to_new_class(obj, + indexes=[ + 'is_folderish', + 'object_provides', + ], + ): + new_class_name = get_portal_type_name_string(obj) + current_class_name = get_old_class_name_string(obj) + + if new_class_name == current_class_name: + return False + + was_item = isinstance(obj, Item) + obj_id = obj.getId() + module_name, class_name = new_class_name.rsplit('.', 1) + module = importlib.import_module(module_name) + new_class = getattr(module, class_name) + + # update obj class + parent = obj.__parent__ + parent._delOb(obj_id) + obj.__class__ = new_class + parent._setOb(obj_id, obj) + + is_container = isinstance(obj, Container) + + # If object was Item likesh and becomes Containerish we have to do few + # preparation + if was_item and is_container: + # update obj _tree, because now it is container + BTreeFolder2Base._initBTrees(obj) + + # reindex + obj.reindexObject(indexes) + + return True + + +def list_of_objects_with_changed_base_class(): + portal = getSite() + + catalog = getToolByName(portal, "portal_catalog") + + for brain in catalog(): + obj = brain.getObject() + if get_portal_type_name_string(obj) != get_old_class_name_string(obj): + yield obj + + +def list_of_changed_base_class_names(): + """Returns list of class names that are not longer in portal_types.""" + changed_base_class_names = {} + for obj in list_of_objects_with_changed_base_class(): + changed_base_class_name = get_old_class_name_string(obj) + if changed_base_class_name not in changed_base_class_names: + number_objects = changed_base_class_names.get( + changed_base_class_name, 0) + changed_base_class_names[changed_base_class_name] = \ + number_objects + 1 + return changed_base_class_names diff --git a/plone/app/contenttypes/migration/vocabularies.py b/plone/app/contenttypes/migration/vocabularies.py index 5c98154..12fcd9c 100644 --- a/plone/app/contenttypes/migration/vocabularies.py +++ b/plone/app/contenttypes/migration/vocabularies.py @@ -203,3 +203,19 @@ def __call__(self, context): extended fields. """ return results(context, show_extended=True) + + +class ChangedBaseClasses(object): + implements(IVocabularyFactory) + + def __call__(self, context): + """Return a vocabulary with all changed base classes.""" + from plone.app.contenttypes.migration.dxmigration import \ + list_of_changed_base_class_names + list_of_class_names = list_of_changed_base_class_names() or {} + return SimpleVocabulary( + [SimpleVocabulary.createTerm( + class_name, class_name, + '{0} ({1})'.format(class_name, list_of_class_names[class_name])) + for class_name in list_of_class_names.keys()] + ) diff --git a/plone/app/contenttypes/tests/test_migration.py b/plone/app/contenttypes/tests/test_migration.py index fd6c0fc..011fc05 100644 --- a/plone/app/contenttypes/tests/test_migration.py +++ b/plone/app/contenttypes/tests/test_migration.py @@ -2,12 +2,19 @@ from Products.CMFCore.utils import getToolByName from five.intid.intid import IntIds from five.intid.site import addUtility +from lxml import etree +from plone.app.contenttypes.testing import \ + PLONE_APP_CONTENTTYPES_FUNCTIONAL_TESTING from plone.app.contenttypes.testing import \ PLONE_APP_CONTENTTYPES_MIGRATION_TESTING from plone.app.contenttypes.testing import set_browserlayer +from plone.app.testing import SITE_OWNER_NAME +from plone.app.testing import SITE_OWNER_PASSWORD from plone.app.testing import applyProfile from plone.app.testing import login +from plone.dexterity.content import Container from plone.event.interfaces import IEventAccessor +from plone.testing.z2 import Browser from zope.annotation.interfaces import IAnnotations from zope.component import getMultiAdapter from zope.component import getSiteManager @@ -1374,3 +1381,125 @@ def get_portlets(context, columnName): dx_folder = self.portal['folder'] self.failUnless('static-portlet' in get_portlets(dx_folder, u'plone.rightcolumn')) + + +class MigrateDexterityBaseClassIntegrationTest(unittest.TestCase): + + layer = PLONE_APP_CONTENTTYPES_MIGRATION_TESTING + + def setUp(self): + self.portal = self.layer['portal'] + + applyProfile(self.portal, 'plone.app.dexterity:testing') + + self.portal.acl_users.userFolderAddUser('admin', + 'secret', + ['Manager'], + []) + login(self.portal, 'admin') + + # Add default content + self.portal.invokeFactory('Document', 'item') + + # Change Document conent type to folderish + portal_types = getToolByName(self.portal, 'portal_types') + portal_types['Document'].klass = 'plone.dexterity.content.Container' + portal_types['Document'].allowed_content_types = ('Document',) + + def test_dxmigration_migrate_item_to_container_class_is_changed(self): + """Check that base class was changed.""" + from plone.app.contenttypes.migration.dxmigration import \ + migrate_base_class_to_new_class + migrate_base_class_to_new_class(self.portal.item) + self.assertTrue(isinstance(self.portal.item, Container)) + + def test_dxmigration_migrate_item_to_container_add_object_inside(self): + """Check that after migrate base class it can add items inside object. + """ + from plone.app.contenttypes.migration.dxmigration import \ + migrate_base_class_to_new_class + migrate_base_class_to_new_class(self.portal.item) + self.portal.item.invokeFactory('Document', 'doc') + self.assertEqual(len(self.portal.item.folderlistingFolderContents()), 1) + + def test_dxmigration_migrate_list_of_objects_with_changed_base_class(self): + """Check list of objects with changed classes.""" + from plone.app.contenttypes.migration.dxmigration import \ + list_of_objects_with_changed_base_class + # We have already one changed object + objects = [i for i in list_of_objects_with_changed_base_class()] + self.assertEqual(len(objects), 1) + + def test_dxmigration_migrate_list_of_changed_base_class_names(self): + """Check list of changed base class names.""" + from plone.app.contenttypes.migration.dxmigration import \ + list_of_changed_base_class_names + # We have already one changed object + names = [i for i in list_of_changed_base_class_names()] + self.assertEqual(len(names), 1) + + def test_dxmigration_migrate_vocabulary_changed_base_classes(self): + """Check vocabulary of changed base class names.""" + # We have already one changed object + name = 'plone.app.contenttypes.migration.changed_base_classes' + factory = getUtility(IVocabularyFactory, name) + vocabulary = factory(self.portal) + self.assertEqual(len(vocabulary), 1) + + +class MigrateDexterityBaseClassFunctionalTest(unittest.TestCase): + + layer = PLONE_APP_CONTENTTYPES_FUNCTIONAL_TESTING + + def setUp(self): + app = self.layer['app'] + self.portal = self.layer['portal'] + self.request = self.layer['request'] + + self.portal_url = self.portal.absolute_url() + self.manage_document_url = '{0}/{1}/{2}/{3}'.format( + self.portal_url, + 'portal_types', + 'Document', + 'manage_propertiesForm', + ) + + self.browser = Browser(app) + self.browser.handleErrors = False + self.browser.addHeader( + 'Authorization', + 'Basic %s:%s' % (SITE_OWNER_NAME, SITE_OWNER_PASSWORD,) + ) + + # Add default content + self.browser.open(self.portal_url) + self.browser.getLink('Page').click() + self.browser.getControl(name='form.widgets.IDublinCore.title')\ + .value = "My item" + self.browser.getControl(name='form.widgets.IShortName.id')\ + .value = "item" + self.browser.getControl('Save').click() + + # Change Document conent type to folderish + self.browser.open(self.manage_document_url) + self.browser.getControl(name='klass:string') \ + .value = 'plone.app.contenttypes.content.Collection' + self.browser.getControl('Save Changes').click() + self.browser.open( + '{0}/@@base_class_migrator_form'.format(self.portal_url)) + self.good_info_message_template = 'There are {0} objects migrated.' + + def test_dxmigration_migrate_check_migration_form_view(self): + """Check base class migrator view of changed base class names.""" + html = etree.HTML(self.browser.contents) + checkboxes = html.xpath('//form//*[@name="{0}"]'.format( + 'form.widgets.changed_base_classes:list')) + self.assertEqual(len(checkboxes), 1) + + def test_dxmigration_migrate_check_migration_successful_message(self): + """Check base class migrator view of changed base class names.""" + self.browser.getControl(name='form.widgets.changed_base_classes:list') \ + .value = ['true'] + self.browser.getControl('Update').click() + self.assertIn( + self.good_info_message_template.format(1), self.browser.contents) Repository: plone.app.contenttypes Branch: refs/heads/master Date: 2014-11-07T11:34:39+01:00 Author: Bogdan Girman (bogdangi) <bogdan.girman@gmail.com> Commit: https://github.com/plone/plone.app.contenttypes/commit/fcb3d1a2786746321758103b4e0c5f01f4dc53da [#18] Add documentation to migrate all to folderish content type Files changed: M docs/README.rst diff --git a/docs/README.rst b/docs/README.rst index 240807e..a4fb850 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -218,6 +218,36 @@ Future versions of plone.app.contenttypes will have with a form that allows you However if you'd like to migrate your content-types to Dexterity before this feature is completed you might want to have a look at the code of plone.app.contenttypes.migration.migration.NewsItemMigrator as a blueprint for a migration. +Migrating non folderish to folderish objects (or change base class for any dexterety base type) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Migration non folderish object to folderish has few steps. + +Step 1 (Update base content types folderish) +------------------------------------------- + +Apply `folderish` profile. + +- Go to portal_setup->Import; + +- Select `Plone default content-types (Folderish behavior) - dexterity` + +- Click `Import all steps` + + +Step 2 (Update base class for exist objects) +-------------------------------------------- + +There is update changed base class migration step which allow you to update base class if last one was changed. + +To get this migration form you have to open follow link `PORTAL_URL/@@base_class_migrator_form`. + +On this view you will see check boxes with class name string and numbers of changed objects that are going to be updated. +Select classes that you want to update and click on button `Update`. + +If migration was successful you see the info box with number of successfully updated objects or warning with number of not updated objects. + + Widgets ------- Repository: plone.app.contenttypes Branch: refs/heads/master Date: 2014-11-07T11:34:39+01:00 Author: Philip Bauer (pbauer) <bauer@starzel.de> Commit: https://github.com/plone/plone.app.contenttypes/commit/7043ce25de4359f257a5ae229f924e6f2f65dbc5 allow folderish collections Files changed: A plone/app/contenttypes/profiles/folderish/types/Collection.xml M plone/app/contenttypes/content.py M plone/app/contenttypes/profiles/folderish/types.xml diff --git a/plone/app/contenttypes/content.py b/plone/app/contenttypes/content.py index dcd673f..07b366d 100644 --- a/plone/app/contenttypes/content.py +++ b/plone/app/contenttypes/content.py @@ -14,6 +14,8 @@ @implementer(ICollection) class Collection(Item): + """Convinience Item subclass for ``Collection`` portal type + """ # BBB def listMetaDataFields(self, exclude=True): @@ -69,47 +71,54 @@ class File(Item): @implementer(IFolder) class Folder(Container): - """Convinience subclass for ``File`` portal type + """Convinience subclass for ``Folder`` portal type """ @implementer(IImage) class Image(Item): - """Convinience subclass for ``File`` portal type + """Convinience subclass for ``Image`` portal type """ @implementer(ILink) class Link(Item): - """Convinience subclass for ``File`` portal type + """Convinience subclass for ``Link`` portal type """ @implementer(INewsItem) class NewsItem(Item): - """Convinience subclass for ``File`` portal type + """Convinience subclass for ``News Item`` portal type """ @implementer(IEvent) class Event(Item): - """Convinience subclass for ``File`` portal type + """Convinience subclass for ``Event`` portal type + """ + +# Folderish subclasses used by 'profile-plone.app.contenttypes:folderish' + +@implementer(ICollection) +class FolderishCollection(Container): + """Folderish convinience subclass for ``Collection`` portal type """ @implementer(IDocument) class FolderishDocument(Container): - """Convinience subclass for ``File`` portal type + """Folderish convinience subclass for ``Document`` portal type """ @implementer(IEvent) class FolderishEvent(Container): - """Convinience subclass for ``File`` portal type + """Folderish convinience subclass for ``Event`` portal type """ @implementer(INewsItem) class FolderishNewsItem(Container): - """Convinience subclass for ``File`` portal type + """Folderish convinience subclass for ``News Item`` portal type """ diff --git a/plone/app/contenttypes/profiles/folderish/types.xml b/plone/app/contenttypes/profiles/folderish/types.xml index 34e8b69..740c1e8 100644 --- a/plone/app/contenttypes/profiles/folderish/types.xml +++ b/plone/app/contenttypes/profiles/folderish/types.xml @@ -1,5 +1,6 @@ <?xml version="1.0"?> <object meta_type="Plone Types Tool" name="portal_types"> + <object meta_type="Dexterity FTI" name="Collection" /> <object meta_type="Dexterity FTI" name="Document" /> <object meta_type="Dexterity FTI" name="News Item" /> <object meta_type="Dexterity FTI" name="Event" /> diff --git a/plone/app/contenttypes/profiles/folderish/types/Collection.xml b/plone/app/contenttypes/profiles/folderish/types/Collection.xml new file mode 100644 index 0000000..a396a48 --- /dev/null +++ b/plone/app/contenttypes/profiles/folderish/types/Collection.xml @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<object name="Collection" meta_type="Dexterity FTI" i18n:domain="plone" + xmlns:i18n="http://xml.zope.org/namespaces/i18n"> + <property name="filter_content_types">False</property> + <property name="klass">plone.app.contenttypes.content.FolderishCollection</property> +</object> Repository: plone.app.contenttypes Branch: refs/heads/master Date: 2014-11-07T11:34:39+01:00 Author: Philip Bauer (pbauer) <bauer@starzel.de> Commit: https://github.com/plone/plone.app.contenttypes/commit/076cef22402645bc476b81ed77e2f0eb55677b3b update documentation Files changed: M docs/README.rst diff --git a/docs/README.rst b/docs/README.rst index a4fb850..b2ea4ab 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -218,35 +218,27 @@ Future versions of plone.app.contenttypes will have with a form that allows you However if you'd like to migrate your content-types to Dexterity before this feature is completed you might want to have a look at the code of plone.app.contenttypes.migration.migration.NewsItemMigrator as a blueprint for a migration. -Migrating non folderish to folderish objects (or change base class for any dexterety base type) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Migrating to folderish objects or change base class for any dexterity type +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Migration non folderish object to folderish has few steps. -Step 1 (Update base content types folderish) -------------------------------------------- - -Apply `folderish` profile. - -- Go to portal_setup->Import; +Step 1: Enable folderish types +++++++++++++++++++++++++++++++ -- Select `Plone default content-types (Folderish behavior) - dexterity` - -- Click `Import all steps` +See `Using folderish types`_ -Step 2 (Update base class for exist objects) --------------------------------------------- +Step 2: Update base class for existing objects +++++++++++++++++++++++++++++++++++++++++++++++ -There is update changed base class migration step which allow you to update base class if last one was changed. +If you changed the base-class of existing types you might also want to upgrade the base-class of existing objects. You can use the following form for this: `PORTAL_URL/@@base_class_migrator_form`. -To get this migration form you have to open follow link `PORTAL_URL/@@base_class_migrator_form`. +On this you will see checkboxes with class names and the amount of objects that are going to be updated. Select classes that you want to update and click on button `Update`. -On this view you will see check boxes with class name string and numbers of changed objects that are going to be updated. -Select classes that you want to update and click on button `Update`. - -If migration was successful you see the info box with number of successfully updated objects or warning with number of not updated objects. +If the migration was successful you see the info box with number of successfully updated objects or a warning with number of not updated objects. +This form can be used to change the base-class of any dexterity-types instances. Widgets ------- @@ -323,6 +315,29 @@ If you want to add plone.app.contenttypes as a dependency from another products If you use the profile ``default`` then the default-content in new sites will still be Archetypes-based. You'll then have to migrate that content using the migration-form ``@@atct_migrator`` or delete it by hand. +Using folderish types +^^^^^^^^^^^^^^^^^^^^^ + +If you want all types folderish you need to depend on the profile ``folderish`` in your own ``metadata.xml``. + +.. code:: xml + + <metadata> + <version>1</version> + <dependencies> + <dependency>profile-plone.app.contenttypes:folderish</dependency> + </dependencies> + </metadata> + +You can also enable this profile by hand by applying the `folderish` profile: + +- Go to portal_setup->Import; +- Select `Plone default content-types (Folderish behavior) - dexterity` +- Click `Import all steps` + +You can also migrate your existing objects to folderish types. For details see `Step 2: Update base class for existing objects`_ + + Extending the types ^^^^^^^^^^^^^^^^^^^ Repository: plone.app.contenttypes Branch: refs/heads/master Date: 2014-11-07T11:39:57+01:00 Author: Philip Bauer (pbauer) <bauer@starzel.de> Commit: https://github.com/plone/plone.app.contenttypes/commit/5c126a25bf10fa27d7ae4c28836a9a6ab17db5af Merge branch 'folderish-optional' of git://github.com/plone/plone.app.contenttypes into folderish-optional Conflicts: plone/app/contenttypes/tests/test_migration.py Files changed: M plone/app/contenttypes/tests/test_migration.py diff --git a/plone/app/contenttypes/tests/test_migration.py b/plone/app/contenttypes/tests/test_migration.py index 011fc05..de60823 100644 --- a/plone/app/contenttypes/tests/test_migration.py +++ b/plone/app/contenttypes/tests/test_migration.py @@ -1289,6 +1289,7 @@ def test_migration_view_confirmation(self): results = migration_view() self.assertIn('@@migrate_from_atct?migrate=1', results) + def test_portlets_are_migrated(self): """add portlets and see if they're still available on the migrated content including portlet settings. Repository: plone.app.contenttypes Branch: refs/heads/master Date: 2014-11-07T12:22:08+01:00 Author: Philip Bauer (pbauer) <bauer@starzel.de> Commit: https://github.com/plone/plone.app.contenttypes/commit/7d80fe0156ea456808cef76bbc60fb6fbef69692 check of multilingual in form to change base-class Files changed: M plone/app/contenttypes/migration/dxmigration.py M plone/app/contenttypes/migration/vocabularies.py diff --git a/plone/app/contenttypes/migration/dxmigration.py b/plone/app/contenttypes/migration/dxmigration.py index 09d1a0b..dcd32cb 100644 --- a/plone/app/contenttypes/migration/dxmigration.py +++ b/plone/app/contenttypes/migration/dxmigration.py @@ -5,12 +5,19 @@ from Products.contentmigration.basemigrator.walker import CatalogWalker from plone.app.contenttypes.interfaces import IEvent from plone.app.contenttypes.migration import datetime_fixer +from plone.app.contenttypes.migration.utils import HAS_MULTILINGUAL from plone.dexterity.content import Container from plone.dexterity.content import Item +from plone.dexterity.interfaces import IDexterityContent from plone.event.utils import default_timezone +from zExceptions import NotFound from zope.annotation.interfaces import IAnnotations from zope.component.hooks import getSite + import importlib +import logging + +logger = logging.getLogger(__name__) def migrate(portal, migrator): @@ -148,10 +155,8 @@ def migrate_base_class_to_new_class(obj, is_container = isinstance(obj, Container) - # If object was Item likesh and becomes Containerish we have to do few - # preparation if was_item and is_container: - # update obj _tree, because now it is container + # If Itemish becomes Folderish we have to update obj _tree BTreeFolder2Base._initBTrees(obj) # reindex @@ -160,21 +165,25 @@ def migrate_base_class_to_new_class(obj, return True -def list_of_objects_with_changed_base_class(): - portal = getSite() - - catalog = getToolByName(portal, "portal_catalog") - - for brain in catalog(): - obj = brain.getObject() +def list_of_objects_with_changed_base_class(context): + catalog = getToolByName(context, "portal_catalog") + query = {'object_provides': IDexterityContent.__identifier__} + if HAS_MULTILINGUAL and 'Language' in catalog.indexes(): + query['Language'] = 'all' + for brain in catalog(query): + try: + obj = brain.getObject() + except NotFound: + logger.warn("Object {0} not found".format(brain.getPath())) + continue if get_portal_type_name_string(obj) != get_old_class_name_string(obj): yield obj -def list_of_changed_base_class_names(): +def list_of_changed_base_class_names(context): """Returns list of class names that are not longer in portal_types.""" changed_base_class_names = {} - for obj in list_of_objects_with_changed_base_class(): + for obj in list_of_objects_with_changed_base_class(context): changed_base_class_name = get_old_class_name_string(obj) if changed_base_class_name not in changed_base_class_names: number_objects = changed_base_class_names.get( diff --git a/plone/app/contenttypes/migration/vocabularies.py b/plone/app/contenttypes/migration/vocabularies.py index 12fcd9c..905812b 100644 --- a/plone/app/contenttypes/migration/vocabularies.py +++ b/plone/app/contenttypes/migration/vocabularies.py @@ -212,7 +212,7 @@ def __call__(self, context): """Return a vocabulary with all changed base classes.""" from plone.app.contenttypes.migration.dxmigration import \ list_of_changed_base_class_names - list_of_class_names = list_of_changed_base_class_names() or {} +…
thet
added a commit
that referenced
this pull request
Mar 24, 2015
Branch: refs/heads/master Date: 2015-03-23T11:54:26+01:00 Author: Johannes Raggam (thet) <raggam-nl@adm.at> Commit: plone/plone.app.z3cform@752cd16 Revert "Revert "Use the more specific browser layer IPloneFormLayer for adapter registrations. This avoids double registration errors."" This reverts commit b61c812e8236fe8294a9059ff89ffce6a40e2a51. Files changed: M CHANGES.rst M plone/app/z3cform/configure.zcml Repository: plone.app.z3cform Branch: refs/heads/master Date: 2015-03-24T01:44:10+01:00 Author: Johannes Raggam (thet) <raggam-nl@adm.at> Commit: plone/plone.app.z3cform@608f973 Merge pull request #18 from plone/thet-iploneformlayer use more specific form layer Files changed: M CHANGES.rst M plone/app/z3cform/configure.zcml
gforcada
added a commit
that referenced
this pull request
Apr 25, 2015
Branch: refs/heads/master Date: 2015-04-24T21:06:17+02:00 Author: Tom Gross (tomgross) <itconsense@gmail.com> Commit: plone/Products.ATContentTypes@6733e3e remove CMFDefault references Files changed: M Products/ATContentTypes/setuphandlers.py M setup.py Repository: Products.ATContentTypes Branch: refs/heads/master Date: 2015-04-24T21:07:41+02:00 Author: Tom Gross (tomgross) <itconsense@gmail.com> Commit: plone/Products.ATContentTypes@7fdde49 remove unnecessary Plone version switch Files changed: M Products/ATContentTypes/setuphandlers.py Repository: Products.ATContentTypes Branch: refs/heads/master Date: 2015-04-24T21:12:22+02:00 Author: Tom Gross (tomgross) <itconsense@gmail.com> Commit: plone/Products.ATContentTypes@dd06d74 added MetadataTool from CMFDefault Files changed: A Products/ATContentTypes/tool/MetadataTool.py Repository: Products.ATContentTypes Branch: refs/heads/master Date: 2015-04-24T21:38:40+02:00 Author: Tom Gross (tomgross) <itconsense@gmail.com> Commit: plone/Products.ATContentTypes@e9dfb56 port all CMFDefault occurenceces Files changed: A Products/ATContentTypes/www/explainMetadataTool.dtml A Products/ATContentTypes/www/metadataElementPolicies.dtml A Products/ATContentTypes/www/metadataProperties.dtml M Products/ATContentTypes/content/document.py M Products/ATContentTypes/tool/metadata.py D Products/ATContentTypes/tool/MetadataTool.py Repository: Products.ATContentTypes Branch: refs/heads/master Date: 2015-04-26T00:17:34+02:00 Author: Gil Forcada Codinachs (gforcada) <gforcada@gnome.org> Commit: plone/Products.ATContentTypes@44549ca Merge pull request #18 from plone/tomgross-nocmfdefault Remove all CMFDefault dependencies Files changed: A Products/ATContentTypes/www/explainMetadataTool.dtml A Products/ATContentTypes/www/metadataElementPolicies.dtml A Products/ATContentTypes/www/metadataProperties.dtml M Products/ATContentTypes/content/document.py M Products/ATContentTypes/setuphandlers.py M Products/ATContentTypes/tool/metadata.py M setup.py
agitator
added a commit
that referenced
this pull request
Jul 30, 2015
Branch: refs/heads/master Date: 2015-07-30T15:42:46+02:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/plone.app.vocabularies@35a85a6 cleanup: pep8, decorators, et al, pimped README Files changed: M CHANGES.rst M README.rst M plone/__init__.py M plone/app/__init__.py M plone/app/vocabularies/__init__.py M plone/app/vocabularies/actions.py M plone/app/vocabularies/catalog.py M plone/app/vocabularies/datetimerelated.py M plone/app/vocabularies/editors.py M plone/app/vocabularies/groups.py M plone/app/vocabularies/interfaces.py M plone/app/vocabularies/language.py M plone/app/vocabularies/security.py M plone/app/vocabularies/skins.py M plone/app/vocabularies/syndication.py M plone/app/vocabularies/terms.py M plone/app/vocabularies/testing.py M plone/app/vocabularies/tests/__init__.py M plone/app/vocabularies/tests/base.py M plone/app/vocabularies/tests/test_timezonevocabularies.py M plone/app/vocabularies/tests/test_vocabularies.py M plone/app/vocabularies/types.py M plone/app/vocabularies/users.py M plone/app/vocabularies/workflow.py M setup.py Repository: plone.app.vocabularies Branch: refs/heads/master Date: 2015-07-30T17:38:21+02:00 Author: agitator (agitator) <hpeter@agitator.com> Commit: plone/plone.app.vocabularies@0d145c2 Merge pull request #18 from plone/jensens-cleanup cleanup: pep8, decorators, et al, pimped README Files changed: M CHANGES.rst M README.rst M plone/__init__.py M plone/app/__init__.py M plone/app/vocabularies/__init__.py M plone/app/vocabularies/actions.py M plone/app/vocabularies/catalog.py M plone/app/vocabularies/datetimerelated.py M plone/app/vocabularies/editors.py M plone/app/vocabularies/groups.py M plone/app/vocabularies/interfaces.py M plone/app/vocabularies/language.py M plone/app/vocabularies/security.py M plone/app/vocabularies/skins.py M plone/app/vocabularies/syndication.py M plone/app/vocabularies/terms.py M plone/app/vocabularies/testing.py M plone/app/vocabularies/tests/__init__.py M plone/app/vocabularies/tests/base.py M plone/app/vocabularies/tests/test_timezonevocabularies.py M plone/app/vocabularies/tests/test_vocabularies.py M plone/app/vocabularies/types.py M plone/app/vocabularies/users.py M plone/app/vocabularies/workflow.py M setup.py
agitator
added a commit
that referenced
this pull request
Jul 30, 2015
Branch: refs/heads/master Date: 2015-07-30T15:42:46+02:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/plone.app.vocabularies@35a85a6 cleanup: pep8, decorators, et al, pimped README Files changed: M CHANGES.rst M README.rst M plone/__init__.py M plone/app/__init__.py M plone/app/vocabularies/__init__.py M plone/app/vocabularies/actions.py M plone/app/vocabularies/catalog.py M plone/app/vocabularies/datetimerelated.py M plone/app/vocabularies/editors.py M plone/app/vocabularies/groups.py M plone/app/vocabularies/interfaces.py M plone/app/vocabularies/language.py M plone/app/vocabularies/security.py M plone/app/vocabularies/skins.py M plone/app/vocabularies/syndication.py M plone/app/vocabularies/terms.py M plone/app/vocabularies/testing.py M plone/app/vocabularies/tests/__init__.py M plone/app/vocabularies/tests/base.py M plone/app/vocabularies/tests/test_timezonevocabularies.py M plone/app/vocabularies/tests/test_vocabularies.py M plone/app/vocabularies/types.py M plone/app/vocabularies/users.py M plone/app/vocabularies/workflow.py M setup.py Repository: plone.app.vocabularies Branch: refs/heads/master Date: 2015-07-30T17:38:21+02:00 Author: agitator (agitator) <hpeter@agitator.com> Commit: plone/plone.app.vocabularies@0d145c2 Merge pull request #18 from plone/jensens-cleanup cleanup: pep8, decorators, et al, pimped README Files changed: M CHANGES.rst M README.rst M plone/__init__.py M plone/app/__init__.py M plone/app/vocabularies/__init__.py M plone/app/vocabularies/actions.py M plone/app/vocabularies/catalog.py M plone/app/vocabularies/datetimerelated.py M plone/app/vocabularies/editors.py M plone/app/vocabularies/groups.py M plone/app/vocabularies/interfaces.py M plone/app/vocabularies/language.py M plone/app/vocabularies/security.py M plone/app/vocabularies/skins.py M plone/app/vocabularies/syndication.py M plone/app/vocabularies/terms.py M plone/app/vocabularies/testing.py M plone/app/vocabularies/tests/__init__.py M plone/app/vocabularies/tests/base.py M plone/app/vocabularies/tests/test_timezonevocabularies.py M plone/app/vocabularies/tests/test_vocabularies.py M plone/app/vocabularies/types.py M plone/app/vocabularies/users.py M plone/app/vocabularies/workflow.py M setup.py
jensens
added a commit
that referenced
this pull request
Sep 21, 2015
Branch: refs/heads/master Date: 2014-09-30T12:28:51+02:00 Author: Harald Friessnegger (frisi) <harald@webmeisterei.com> Commit: plone/Products.ResourceRegistries@03f732d handle theme names containing a `.` correctly. zpublisher puts them into another namespace so manage_saveBundlesFortheme won't find theme. eg ``REQUEST.form`` is:: {'mappings.my': {'theme': ['jquery', 'mytheme']}, 'mappings': {'Plone Classic Theme': ['jquery', 'default'], 'Plone Default': ['jquery', 'default'], 'Sunburst Theme': ['jquery', 'default']}} instead of:: {'mappings': {'my.theme': ['jquery', 'mytheme'], 'Plone Classic Theme': ['jquery', 'default'], 'Plone Default': ['jquery', 'default'], 'Sunburst Theme': ['jquery', 'default']}} we work around this by replacing dots with `___` in the form handling. Files changed: M CHANGES.rst M Products/ResourceRegistries/tools/BaseRegistry.py M Products/ResourceRegistries/www/bundles.zpt Repository: Products.ResourceRegistries Branch: refs/heads/master Date: 2015-09-22T01:13:48+02:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/Products.ResourceRegistries@67dd9be Merge pull request #18 from plone/zmi-fix handle theme names containing a `.` correctly. Files changed: M CHANGES.rst M Products/ResourceRegistries/tools/BaseRegistry.py M Products/ResourceRegistries/www/bundles.zpt
vangheem
added a commit
that referenced
this pull request
Sep 26, 2015
Branch: refs/heads/master Date: 2015-09-26T05:37:48-05:00 Author: vangheem (vangheem) <vangheem@gmail.com> Commit: plone/plone.protect@e289abb change pluggable auth patches to marmoset Files changed: A plone/protect/tests/testPatches.py M CHANGES.rst M plone/protect/configure.zcml M plone/protect/monkey.py Repository: plone.protect Branch: refs/heads/master Date: 2015-09-26T05:38:12-05:00 Author: Nathan Van Gheem (vangheem) <vangheem@gmail.com> Commit: plone/plone.protect@44d51ee Merge pull request #18 from plone/repatch-pluggableauth change pluggable auth patches to marmoset Files changed: A plone/protect/tests/testPatches.py M CHANGES.rst M plone/protect/configure.zcml M plone/protect/monkey.py
gforcada
added a commit
that referenced
this pull request
Nov 25, 2015
Branch: refs/heads/master Date: 2015-11-22T21:13:29-03:00 Author: Davi Lima (davilima6) <davilima6@gmail.com> Commit: plone/plone.app.caching@aefcfc0 Update Site Setup link in all control panels (fixes plone/Products.CMFPlone#1255) Files changed: M CHANGES.rst M plone/app/caching/browser/controlpanel.py M plone/app/caching/browser/import.pt M plone/app/caching/browser/purge.pt M plone/app/caching/browser/ramcache.pt Repository: plone.app.caching Branch: refs/heads/master Date: 2015-11-25T01:32:40+01:00 Author: Gil Forcada Codinachs (gforcada) <gil.forcada@freitag.de> Commit: plone/plone.app.caching@f89dac0 Merge pull request #18 from plone/fix_sitesetup_link Update Site Setup link in all control panels Files changed: M CHANGES.rst M plone/app/caching/browser/controlpanel.py M plone/app/caching/browser/import.pt M plone/app/caching/browser/purge.pt M plone/app/caching/browser/ramcache.pt
gforcada
added a commit
that referenced
this pull request
Nov 25, 2015
Branch: refs/heads/master Date: 2015-11-22T01:53:18+01:00 Author: Rafael Oliveira (rafaelbco) <rafaelbco@gmail.com> Commit: plone/plone.app.versioningbehavior@fb583a6 Fixes #10: Views for Image and File versions don't work. Files changed: M CHANGES.rst M plone/app/versioningbehavior/browser.py M plone/app/versioningbehavior/configure.zcml Repository: plone.app.versioningbehavior Branch: refs/heads/master Date: 2015-11-22T01:53:18+01:00 Author: Rafael Oliveira (rafaelbco) <rafaelbco@gmail.com> Commit: plone/plone.app.versioningbehavior@40927fe @@version-view: Handle file fields defined in behaviors when converting download URLs. Files changed: M plone/app/versioningbehavior/browser.py Repository: plone.app.versioningbehavior Branch: refs/heads/master Date: 2015-11-25T12:17:45+01:00 Author: Gil Forcada Codinachs (gforcada) <gil.forcada@freitag.de> Commit: plone/plone.app.versioningbehavior@1bb4988 Merge pull request #20 from syslabcom/master Refs #18 - Fix for Views for Image and File versions don't work. Files changed: M CHANGES.rst M plone/app/versioningbehavior/browser.py M plone/app/versioningbehavior/configure.zcml
mauritsvanrees
added a commit
that referenced
this pull request
Nov 26, 2015
Branch: refs/heads/1.0.x Date: 2015-11-19T22:47:33+01:00 Author: Rodrigo Ferreira de Souza (rodfersou) <rodfersou@gmail.com> Commit: plone/plone.app.imaging@59e8d2b Handled scale traversal correctly in zope.pagetemplate and five.pt (chameleon). Files changed: M docs/HISTORY.txt M src/plone/app/imaging/scaling.py M src/plone/app/imaging/tests/test_new_scaling.py Repository: plone.app.imaging Branch: refs/heads/1.0.x Date: 2015-11-26T01:06:09+01:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.app.imaging@9022a3d Merge pull request #18 from plone/issue_16_1x Issue 16 1.0.x - Fix incompatibilities with five.pt and chameleon Files changed: M docs/HISTORY.txt M src/plone/app/imaging/scaling.py M src/plone/app/imaging/tests/test_new_scaling.py
jensens
added a commit
that referenced
this pull request
Dec 3, 2015
Branch: refs/heads/master Date: 2015-11-18T11:01:12+01:00 Author: Julian Handl (julianhandl) <julian.handl@gmail.com> Commit: plone/plone.formwidget.recurrence@b6f08e9 Fix index out of range bug for current batch Files changed: M plone/formwidget/recurrence/browser/json_recurrence.py Repository: plone.formwidget.recurrence Branch: refs/heads/master Date: 2015-11-18T11:06:11+01:00 Author: Julian Handl (julianhandl) <julian.handl@gmail.com> Commit: plone/plone.formwidget.recurrence@2abc01b Update CHANGES.rst Files changed: M CHANGES.rst Repository: plone.formwidget.recurrence Branch: refs/heads/master Date: 2015-12-04T00:24:50+01:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/plone.formwidget.recurrence@9991a0c Merge pull request #18 from julianhandl/master Fix index out of range bug for current batch Files changed: M CHANGES.rst M plone/formwidget/recurrence/browser/json_recurrence.py
mister-roboto
pushed a commit
that referenced
this pull request
Jan 12, 2016
Branch: refs/heads/master Date: 2016-01-11T16:37:35-02:00 Author: Bruno Barbosa () <bruno.bbbs@dpf.gov.br> Commit: plone/plone.app.testing@8c34c82 Fix path called after import Files changed: M docs/source/views.rst Repository: plone.app.testing Branch: refs/heads/master Date: 2016-01-12T11:50:44+01:00 Author: Gil Forcada Codinachs (gforcada) <gil.forcada@freitag.de> Commit: plone/plone.app.testing@90636f0 Merge pull request #18 from brunobbbs/master Fix path called after import Files changed: M docs/source/views.rst
mister-roboto
pushed a commit
that referenced
this pull request
Jan 27, 2016
Branch: refs/heads/master Date: 2016-01-27T14:08:19+01:00 Author: Stephan Klinger (staeff) <stephan.klinger@freitag.de> Commit: plone/plone.formwidget.namedfile@869f445 Use plone i18n domain Files changed: M plone/formwidget/namedfile/__init__.py M plone/formwidget/namedfile/configure.zcml M plone/formwidget/namedfile/file_display.pt M plone/formwidget/namedfile/file_input.pt M plone/formwidget/namedfile/image_display.pt M plone/formwidget/namedfile/image_input.pt Repository: plone.formwidget.namedfile Branch: refs/heads/master Date: 2016-01-27T14:23:58+01:00 Author: Stephan Klinger (staeff) <stephan.klinger@freitag.de> Commit: plone/plone.formwidget.namedfile@d565022 Update CHANGES.txt Files changed: M CHANGES.rst Repository: plone.formwidget.namedfile Branch: refs/heads/master Date: 2016-01-27T14:34:43+01:00 Author: Vincent Fretin (vincentfretin) <vincent.fretin@gmail.com> Commit: plone/plone.formwidget.namedfile@a27a461 Merge pull request #18 from plone/use-plone-i18n-domain Use plone i18n domain Files changed: M CHANGES.rst M plone/formwidget/namedfile/__init__.py M plone/formwidget/namedfile/configure.zcml M plone/formwidget/namedfile/file_display.pt M plone/formwidget/namedfile/file_input.pt M plone/formwidget/namedfile/image_display.pt M plone/formwidget/namedfile/image_input.pt
mister-roboto
pushed a commit
that referenced
this pull request
Jan 27, 2016
Branch: refs/heads/master Date: 2016-01-27T14:08:19+01:00 Author: Stephan Klinger (staeff) <stephan.klinger@freitag.de> Commit: plone/plone.formwidget.namedfile@869f445 Use plone i18n domain Files changed: M plone/formwidget/namedfile/__init__.py M plone/formwidget/namedfile/configure.zcml M plone/formwidget/namedfile/file_display.pt M plone/formwidget/namedfile/file_input.pt M plone/formwidget/namedfile/image_display.pt M plone/formwidget/namedfile/image_input.pt Repository: plone.formwidget.namedfile Branch: refs/heads/master Date: 2016-01-27T14:23:58+01:00 Author: Stephan Klinger (staeff) <stephan.klinger@freitag.de> Commit: plone/plone.formwidget.namedfile@d565022 Update CHANGES.txt Files changed: M CHANGES.rst Repository: plone.formwidget.namedfile Branch: refs/heads/master Date: 2016-01-27T14:34:43+01:00 Author: Vincent Fretin (vincentfretin) <vincent.fretin@gmail.com> Commit: plone/plone.formwidget.namedfile@a27a461 Merge pull request #18 from plone/use-plone-i18n-domain Use plone i18n domain Files changed: M CHANGES.rst M plone/formwidget/namedfile/__init__.py M plone/formwidget/namedfile/configure.zcml M plone/formwidget/namedfile/file_display.pt M plone/formwidget/namedfile/file_input.pt M plone/formwidget/namedfile/image_display.pt M plone/formwidget/namedfile/image_input.pt
mister-roboto
pushed a commit
that referenced
this pull request
Jan 29, 2016
Branch: refs/heads/master Date: 2016-01-28T15:48:22+01:00 Author: Johannes Raggam (thet) <thetetet@gmail.com> Commit: plone/plone.testing@431c757 Fix tests for Zope 4, where the app root Control_Panel is not available anymore. Files changed: M CHANGES.rst M src/plone/testing/z2.rst Repository: plone.testing Branch: refs/heads/master Date: 2016-01-29T02:38:39+01:00 Author: Johannes Raggam (thet) <thetetet@gmail.com> Commit: plone/plone.testing@0e78648 Merge pull request #18 from plone/thet-zope4 Zope4 Files changed: M CHANGES.rst M src/plone/testing/z2.rst
mister-roboto
pushed a commit
that referenced
this pull request
Jan 29, 2016
Branch: refs/heads/master Date: 2016-01-28T15:48:22+01:00 Author: Johannes Raggam (thet) <thetetet@gmail.com> Commit: plone/plone.testing@431c757 Fix tests for Zope 4, where the app root Control_Panel is not available anymore. Files changed: M CHANGES.rst M src/plone/testing/z2.rst Repository: plone.testing Branch: refs/heads/master Date: 2016-01-29T02:38:39+01:00 Author: Johannes Raggam (thet) <thetetet@gmail.com> Commit: plone/plone.testing@0e78648 Merge pull request #18 from plone/thet-zope4 Zope4 Files changed: M CHANGES.rst M src/plone/testing/z2.rst
mister-roboto
pushed a commit
that referenced
this pull request
May 12, 2016
Branch: refs/heads/master Date: 2016-05-08T23:32:06+12:00 Author: Tommy Yu (metatoaster) <tommy.yu@auckland.ac.nz> Commit: plone/plone.app.registry@1a93810 Tests for choice schema constraints - Will work correctly if plone/plone.supermodel#12 is merged. Files changed: M plone/app/registry/tests/test_exportimport.py Repository: plone.app.registry Branch: refs/heads/master Date: 2016-05-12T23:46:08+02:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/plone.app.registry@65a450e Merge pull request #18 from metatoaster/plone_supermodel_pr_12 Tests for choice schema constraints Files changed: M plone/app/registry/tests/test_exportimport.py
mister-roboto
pushed a commit
that referenced
this pull request
May 12, 2016
Branch: refs/heads/master Date: 2016-05-08T23:32:06+12:00 Author: Tommy Yu (metatoaster) <tommy.yu@auckland.ac.nz> Commit: plone/plone.app.registry@1a93810 Tests for choice schema constraints - Will work correctly if plone/plone.supermodel#12 is merged. Files changed: M plone/app/registry/tests/test_exportimport.py Repository: plone.app.registry Branch: refs/heads/master Date: 2016-05-12T23:46:08+02:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/plone.app.registry@65a450e Merge pull request #18 from metatoaster/plone_supermodel_pr_12 Tests for choice schema constraints Files changed: M plone/app/registry/tests/test_exportimport.py
mister-roboto
pushed a commit
that referenced
this pull request
May 17, 2016
Branch: refs/heads/master Date: 2016-05-13T15:01:10+02:00 Author: Rene Jochum (pcdummy) <rene@jochums.at> Commit: plone/Products.PlonePAS@f3eb8c0 Use the _marker from CMFCore for MemberDataTool. Signed-off-by: Rene Jochum <rene@jochums.at> Files changed: M CHANGES.rst M src/Products/PlonePAS/tools/memberdata.py Repository: Products.PlonePAS Branch: refs/heads/master Date: 2016-05-13T21:12:06+02:00 Author: Rene Jochum (pcdummy) <rene@jochums.at> Commit: plone/Products.PlonePAS@34d2c86 Don't raise a ValueError if a property doesn't exists. Signed-off-by: Rene Jochum <rene@jochums.at> Files changed: M CHANGES.rst M src/Products/PlonePAS/tools/memberdata.py Repository: Products.PlonePAS Branch: refs/heads/master Date: 2016-05-17T10:13:25+02:00 Author: Johannes Raggam (thet) <thetetet@gmail.com> Commit: plone/Products.PlonePAS@089fca6 Merge pull request #18 from plone/marker_fix Use the _marker from CMFCore for MemberDataTool. Files changed: M CHANGES.rst M src/Products/PlonePAS/tools/memberdata.py
mister-roboto
pushed a commit
that referenced
this pull request
May 17, 2016
Branch: refs/heads/master Date: 2016-05-13T15:01:10+02:00 Author: Rene Jochum (pcdummy) <rene@jochums.at> Commit: plone/Products.PlonePAS@f3eb8c0 Use the _marker from CMFCore for MemberDataTool. Signed-off-by: Rene Jochum <rene@jochums.at> Files changed: M CHANGES.rst M src/Products/PlonePAS/tools/memberdata.py Repository: Products.PlonePAS Branch: refs/heads/master Date: 2016-05-13T21:12:06+02:00 Author: Rene Jochum (pcdummy) <rene@jochums.at> Commit: plone/Products.PlonePAS@34d2c86 Don't raise a ValueError if a property doesn't exists. Signed-off-by: Rene Jochum <rene@jochums.at> Files changed: M CHANGES.rst M src/Products/PlonePAS/tools/memberdata.py Repository: Products.PlonePAS Branch: refs/heads/master Date: 2016-05-17T10:13:25+02:00 Author: Johannes Raggam (thet) <thetetet@gmail.com> Commit: plone/Products.PlonePAS@089fca6 Merge pull request #18 from plone/marker_fix Use the _marker from CMFCore for MemberDataTool. Files changed: M CHANGES.rst M src/Products/PlonePAS/tools/memberdata.py
mister-roboto
pushed a commit
that referenced
this pull request
May 17, 2016
Branch: refs/heads/master Date: 2016-05-13T15:01:10+02:00 Author: Rene Jochum (pcdummy) <rene@jochums.at> Commit: plone/Products.PlonePAS@f3eb8c0 Use the _marker from CMFCore for MemberDataTool. Signed-off-by: Rene Jochum <rene@jochums.at> Files changed: M CHANGES.rst M src/Products/PlonePAS/tools/memberdata.py Repository: Products.PlonePAS Branch: refs/heads/master Date: 2016-05-13T21:12:06+02:00 Author: Rene Jochum (pcdummy) <rene@jochums.at> Commit: plone/Products.PlonePAS@34d2c86 Don't raise a ValueError if a property doesn't exists. Signed-off-by: Rene Jochum <rene@jochums.at> Files changed: M CHANGES.rst M src/Products/PlonePAS/tools/memberdata.py Repository: Products.PlonePAS Branch: refs/heads/master Date: 2016-05-17T10:13:25+02:00 Author: Johannes Raggam (thet) <thetetet@gmail.com> Commit: plone/Products.PlonePAS@089fca6 Merge pull request #18 from plone/marker_fix Use the _marker from CMFCore for MemberDataTool. Files changed: M CHANGES.rst M src/Products/PlonePAS/tools/memberdata.py
mister-roboto
pushed a commit
that referenced
this pull request
Jul 6, 2016
Branch: refs/heads/master Date: 2016-07-05T23:15:52+02:00 Author: Gil Forcada (gforcada) <gforcada@gnome.org> Commit: plone/plone.formwidget.autocomplete@251a042 Use zope.interface decorator This not only makes code more pleasent to read, but also makes the code python 3 compatible (while maintaining python 2 compatibility). Files changed: M CHANGES.rst M plone/formwidget/autocomplete/demo.py M plone/formwidget/autocomplete/widget.py Repository: plone.formwidget.autocomplete Branch: refs/heads/master Date: 2016-07-07T00:52:19+02:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.formwidget.autocomplete@2b10987 Merge pull request #18 from plone/gforcada-use-zope-decorators Use zope.interface decorator Files changed: M CHANGES.rst M plone/formwidget/autocomplete/demo.py M plone/formwidget/autocomplete/widget.py
mister-roboto
pushed a commit
that referenced
this pull request
Jul 6, 2016
Branch: refs/heads/master Date: 2016-07-05T23:15:52+02:00 Author: Gil Forcada (gforcada) <gforcada@gnome.org> Commit: plone/plone.formwidget.autocomplete@251a042 Use zope.interface decorator This not only makes code more pleasent to read, but also makes the code python 3 compatible (while maintaining python 2 compatibility). Files changed: M CHANGES.rst M plone/formwidget/autocomplete/demo.py M plone/formwidget/autocomplete/widget.py Repository: plone.formwidget.autocomplete Branch: refs/heads/master Date: 2016-07-07T00:52:19+02:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.formwidget.autocomplete@2b10987 Merge pull request #18 from plone/gforcada-use-zope-decorators Use zope.interface decorator Files changed: M CHANGES.rst M plone/formwidget/autocomplete/demo.py M plone/formwidget/autocomplete/widget.py
mister-roboto
pushed a commit
that referenced
this pull request
Jul 6, 2016
Branch: refs/heads/master Date: 2016-07-05T23:15:52+02:00 Author: Gil Forcada (gforcada) <gforcada@gnome.org> Commit: plone/plone.formwidget.autocomplete@251a042 Use zope.interface decorator This not only makes code more pleasent to read, but also makes the code python 3 compatible (while maintaining python 2 compatibility). Files changed: M CHANGES.rst M plone/formwidget/autocomplete/demo.py M plone/formwidget/autocomplete/widget.py Repository: plone.formwidget.autocomplete Branch: refs/heads/master Date: 2016-07-07T00:52:19+02:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.formwidget.autocomplete@2b10987 Merge pull request #18 from plone/gforcada-use-zope-decorators Use zope.interface decorator Files changed: M CHANGES.rst M plone/formwidget/autocomplete/demo.py M plone/formwidget/autocomplete/widget.py
mister-roboto
pushed a commit
that referenced
this pull request
Jul 6, 2016
Branch: refs/heads/master Date: 2016-07-05T23:16:07+02:00 Author: Gil Forcada (gforcada) <gforcada@gnome.org> Commit: plone/plone.formwidget.datetime@64123d6 Use zope.interface decorator This not only makes code more pleasent to read, but also makes the code python 3 compatible (while maintaining python 2 compatibility). Files changed: M CHANGES.rst M plone/formwidget/datetime/setuphandlers.py M plone/formwidget/datetime/z3cform/widget.py Repository: plone.formwidget.datetime Branch: refs/heads/master Date: 2016-07-07T00:58:49+02:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.formwidget.datetime@5b7c123 Merge pull request #18 from plone/gforcada-use-zope-decorators Use zope.interface decorator Files changed: M CHANGES.rst M plone/formwidget/datetime/setuphandlers.py M plone/formwidget/datetime/z3cform/widget.py
mister-roboto
pushed a commit
that referenced
this pull request
Jul 6, 2016
Branch: refs/heads/master Date: 2016-07-05T23:16:07+02:00 Author: Gil Forcada (gforcada) <gforcada@gnome.org> Commit: plone/plone.formwidget.datetime@64123d6 Use zope.interface decorator This not only makes code more pleasent to read, but also makes the code python 3 compatible (while maintaining python 2 compatibility). Files changed: M CHANGES.rst M plone/formwidget/datetime/setuphandlers.py M plone/formwidget/datetime/z3cform/widget.py Repository: plone.formwidget.datetime Branch: refs/heads/master Date: 2016-07-07T00:58:49+02:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.formwidget.datetime@5b7c123 Merge pull request #18 from plone/gforcada-use-zope-decorators Use zope.interface decorator Files changed: M CHANGES.rst M plone/formwidget/datetime/setuphandlers.py M plone/formwidget/datetime/z3cform/widget.py
mister-roboto
pushed a commit
that referenced
this pull request
Sep 22, 2018
Branch: refs/heads/master Date: 2018-09-22T17:56:45+02:00 Author: ale-rt (ale-rt) <alessandro.pisa@gmail.com> Commit: plone/plone.app.folder@0a5bbdd Fix missing ``dict.has_key`` in Python3 Files changed: M CHANGES.rst M src/plone/app/folder/migration.py Repository: plone.app.folder Branch: refs/heads/master Date: 2018-09-22T19:30:56+02:00 Author: Alessandro Pisa (ale-rt) <alessandro.pisa@gmail.com> Commit: plone/plone.app.folder@038fca7 Merge pull request #18 from plone/python3 Fix missing ``dict.has_key`` in Python3 Files changed: M CHANGES.rst M src/plone/app/folder/migration.py
mister-roboto
pushed a commit
that referenced
this pull request
Oct 3, 2018
Branch: refs/heads/master Date: 2018-10-03T13:46:40+02:00 Author: Peter Mathis (petschki) <peter.mathis@kombinat.at> Commit: plone/Products.CMFFormController@0b22727 add tearDown method to avoid isolation errors Files changed: M Products/CMFFormController/tests/testRedirectTo.py Repository: Products.CMFFormController Branch: refs/heads/master Date: 2018-10-03T16:00:33+02:00 Author: Peter Mathis (petschki) <peter.mathis@kombinat.at> Commit: plone/Products.CMFFormController@646de39 add changenote Files changed: A news/18.bugfix Repository: Products.CMFFormController Branch: refs/heads/master Date: 2018-10-03T17:07:21+02:00 Author: Peter Mathis (petschki) <petschki@users.noreply.github.com> Commit: plone/Products.CMFFormController@f1d39e0 Merge pull request #18 from plone/testisolation-fix testisolation fixes Files changed: A news/18.bugfix M Products/CMFFormController/tests/testRedirectTo.py
mister-roboto
pushed a commit
that referenced
this pull request
Oct 5, 2018
Branch: refs/heads/master Date: 2018-10-04T17:46:14+02:00 Author: Manuel Reinhardt (reinhardt) <reinhardt@syslab.com> Commit: plone/plone.app.workflow@86bcff7 Replaced usages of my_worklist.py skin script which is going to be removed. Files changed: M CHANGES.rst M plone/app/workflow/tests/test_plone_workflow.py Repository: plone.app.workflow Branch: refs/heads/master Date: 2018-10-05T14:45:13+02:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/plone.app.workflow@8450f9c Merge pull request #18 from plone/1801-remove-my-worklist Replaced usages of my_worklist.py skin script Files changed: M CHANGES.rst M plone/app/workflow/tests/test_plone_workflow.py
mister-roboto
pushed a commit
that referenced
this pull request
Oct 18, 2018
Branch: refs/heads/master Date: 2018-10-18T17:06:19+02:00 Author: Philip Bauer (pbauer) <bauer@starzel.de> Commit: plone/plone.app.viewletmanager@a8c3a8c fix another TypeError Files changed: M CHANGES.rst M plone/app/viewletmanager/manager.py Repository: plone.app.viewletmanager Branch: refs/heads/master Date: 2018-10-18T22:18:02+02:00 Author: Philip Bauer (pbauer) <bauer@starzel.de> Commit: plone/plone.app.viewletmanager@f5d9e83 Merge pull request #18 from plone/fix_sorting fix another TypeError Files changed: M CHANGES.rst M plone/app/viewletmanager/manager.py
mister-roboto
pushed a commit
that referenced
this pull request
Nov 13, 2018
Branch: refs/heads/master Date: 2018-11-11T11:58:38+01:00 Author: Gil Forcada (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.cachepurging@702399d Remove five.globalrequest It has been merged to Zope 4. Files changed: M CHANGES.rst M plone/cachepurging/configure.zcml M setup.py Repository: plone.cachepurging Branch: refs/heads/master Date: 2018-11-13T21:58:32+01:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.cachepurging@6780fc7 Remove Plone 5.1 trove classifier As the five.globalrequest makes it only compatible with Plone 5.2 (and actually Zope 4). Files changed: M setup.py Repository: plone.cachepurging Branch: refs/heads/master Date: 2018-11-13T21:59:07+01:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.cachepurging@58c0ade Merge pull request #18 from plone/remove-five-globalrequest Remove five.globalrequest Files changed: M CHANGES.rst M plone/cachepurging/configure.zcml M setup.py
mister-roboto
pushed a commit
that referenced
this pull request
Feb 8, 2019
Branch: refs/heads/master Date: 2019-02-08T14:30:24+01:00 Author: Wolfgang Thomas (pysailor) <thomas@syslab.com> Commit: plone/plone.behavior@c4bac66 Implementation of proposal #18 Files changed: M CHANGES.rst M README.rst M plone/behavior/metaconfigure.py M plone/behavior/registration.py Repository: plone.behavior Branch: refs/heads/master Date: 2019-02-08T14:31:12+01:00 Author: Wolfgang Thomas (pysailor) <thomas@syslab.com> Commit: plone/plone.behavior@e24fd31 make code analysis happy Files changed: M plone/behavior/interfaces.py M plone/behavior/metaconfigure.py M plone/behavior/registration.py Repository: plone.behavior Branch: refs/heads/master Date: 2019-02-08T14:31:13+01:00 Author: Wolfgang Thomas (pysailor) <thomas@syslab.com> Commit: plone/plone.behavior@b81907e Enhance doctests to demonstrate the ``former_dotted_names`` feature Files changed: M plone/behavior/directives.rst M plone/behavior/tests.py Repository: plone.behavior Branch: refs/heads/master Date: 2019-02-08T15:57:23+01:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/plone.behavior@a74655b Merge pull request #19 from plone/18-former-dotted-names Implementation of proposal #18 Files changed: M CHANGES.rst M README.rst M plone/behavior/directives.rst M plone/behavior/interfaces.py M plone/behavior/metaconfigure.py M plone/behavior/registration.py M plone/behavior/tests.py
mister-roboto
pushed a commit
that referenced
this pull request
Feb 8, 2019
Branch: refs/heads/master Date: 2019-02-08T14:30:24+01:00 Author: Wolfgang Thomas (pysailor) <thomas@syslab.com> Commit: plone/plone.behavior@c4bac66 Implementation of proposal #18 Files changed: M CHANGES.rst M README.rst M plone/behavior/metaconfigure.py M plone/behavior/registration.py Repository: plone.behavior Branch: refs/heads/master Date: 2019-02-08T14:31:12+01:00 Author: Wolfgang Thomas (pysailor) <thomas@syslab.com> Commit: plone/plone.behavior@e24fd31 make code analysis happy Files changed: M plone/behavior/interfaces.py M plone/behavior/metaconfigure.py M plone/behavior/registration.py Repository: plone.behavior Branch: refs/heads/master Date: 2019-02-08T14:31:13+01:00 Author: Wolfgang Thomas (pysailor) <thomas@syslab.com> Commit: plone/plone.behavior@b81907e Enhance doctests to demonstrate the ``former_dotted_names`` feature Files changed: M plone/behavior/directives.rst M plone/behavior/tests.py Repository: plone.behavior Branch: refs/heads/master Date: 2019-02-08T15:57:23+01:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/plone.behavior@a74655b Merge pull request #19 from plone/18-former-dotted-names Implementation of proposal #18 Files changed: M CHANGES.rst M README.rst M plone/behavior/directives.rst M plone/behavior/interfaces.py M plone/behavior/metaconfigure.py M plone/behavior/registration.py M plone/behavior/tests.py
mister-roboto
pushed a commit
that referenced
this pull request
Feb 8, 2019
Branch: refs/heads/master Date: 2019-02-08T14:30:24+01:00 Author: Wolfgang Thomas (pysailor) <thomas@syslab.com> Commit: plone/plone.behavior@c4bac66 Implementation of proposal #18 Files changed: M CHANGES.rst M README.rst M plone/behavior/metaconfigure.py M plone/behavior/registration.py Repository: plone.behavior Branch: refs/heads/master Date: 2019-02-08T14:31:12+01:00 Author: Wolfgang Thomas (pysailor) <thomas@syslab.com> Commit: plone/plone.behavior@e24fd31 make code analysis happy Files changed: M plone/behavior/interfaces.py M plone/behavior/metaconfigure.py M plone/behavior/registration.py Repository: plone.behavior Branch: refs/heads/master Date: 2019-02-08T14:31:13+01:00 Author: Wolfgang Thomas (pysailor) <thomas@syslab.com> Commit: plone/plone.behavior@b81907e Enhance doctests to demonstrate the ``former_dotted_names`` feature Files changed: M plone/behavior/directives.rst M plone/behavior/tests.py Repository: plone.behavior Branch: refs/heads/master Date: 2019-02-08T15:57:23+01:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/plone.behavior@a74655b Merge pull request #19 from plone/18-former-dotted-names Implementation of proposal #18 Files changed: M CHANGES.rst M README.rst M plone/behavior/directives.rst M plone/behavior/interfaces.py M plone/behavior/metaconfigure.py M plone/behavior/registration.py M plone/behavior/tests.py
mister-roboto
pushed a commit
that referenced
this pull request
Mar 6, 2019
Branch: refs/heads/master Date: 2019-03-04T17:23:48+01:00 Author: Peter Holzer (agitator) <peter.holzer@agitator.com> Commit: plone/plone.staticresources@bfaad84 add news Files changed: A news/18.bugfix Repository: plone.staticresources Branch: refs/heads/master Date: 2019-03-04T17:23:48+01:00 Author: Peter Holzer (agitator) <peter.holzer@agitator.com> Commit: plone/plone.staticresources@f8dbe02 update last_compilation Files changed: M src/plone/staticresources/profiles/default/registry/bundles.xml Repository: plone.staticresources Branch: refs/heads/master Date: 2019-03-04T18:01:09+01:00 Author: Peter Holzer (agitator) <peter.holzer@agitator.com> Commit: plone/plone.staticresources@8adfb3b update bundle after rebase Files changed: M src/plone/staticresources/static/plone-compiled.css.map M src/plone/staticresources/static/plone-compiled.js M src/plone/staticresources/static/plone-compiled.min.js M src/plone/staticresources/static/plone-compiled.min.js.map Repository: plone.staticresources Branch: refs/heads/master Date: 2019-03-06T15:03:20+01:00 Author: agitator (agitator) <agitator@users.noreply.github.com> Commit: plone/plone.staticresources@e15ff6d fix compilation date Files changed: M src/plone/staticresources/profiles/default/registry/bundles.xml Repository: plone.staticresources Branch: refs/heads/master Date: 2019-03-06T18:26:28+01:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/plone.staticresources@d3e3222 Merge pull request #18 from plone/nav-improvements Update plone bundle with fix for highlighting current item in nav for… Files changed: A news/18.bugfix M src/plone/staticresources/profiles/default/registry/bundles.xml M src/plone/staticresources/static/plone-compiled.css.map M src/plone/staticresources/static/plone-compiled.js M src/plone/staticresources/static/plone-compiled.min.js M src/plone/staticresources/static/plone-compiled.min.js.map
mister-roboto
pushed a commit
that referenced
this pull request
Apr 11, 2020
Branch: refs/heads/master Date: 2020-04-10T16:36:39+02:00 Author: ale-rt (ale-rt) <alessandro.pisa@gmail.com> Commit: plone/plone.memoize@06607af Make code black Preparation for #17 Files changed: A news/17.bugfix M bootstrap-buildout.py M plone/__init__.py M plone/memoize/compress.py M plone/memoize/forever.py M plone/memoize/instance.py M plone/memoize/interfaces.py M plone/memoize/ram.py M plone/memoize/request.py M plone/memoize/tests.py M plone/memoize/view.py M plone/memoize/volatile.py M setup.py Repository: plone.memoize Branch: refs/heads/master Date: 2020-04-11T10:46:53+02:00 Author: Alessandro Pisa (ale-rt) <alessandro.pisa@gmail.com> Commit: plone/plone.memoize@0e94832 Merge pull request #18 from plone/17-black Make code black Files changed: A news/17.bugfix M bootstrap-buildout.py M plone/__init__.py M plone/memoize/compress.py M plone/memoize/forever.py M plone/memoize/instance.py M plone/memoize/interfaces.py M plone/memoize/ram.py M plone/memoize/request.py M plone/memoize/tests.py M plone/memoize/view.py M plone/memoize/volatile.py M setup.py
mister-roboto
pushed a commit
that referenced
this pull request
Apr 11, 2020
Branch: refs/heads/master Date: 2020-04-10T16:36:39+02:00 Author: ale-rt (ale-rt) <alessandro.pisa@gmail.com> Commit: plone/plone.memoize@06607af Make code black Preparation for #17 Files changed: A news/17.bugfix M bootstrap-buildout.py M plone/__init__.py M plone/memoize/compress.py M plone/memoize/forever.py M plone/memoize/instance.py M plone/memoize/interfaces.py M plone/memoize/ram.py M plone/memoize/request.py M plone/memoize/tests.py M plone/memoize/view.py M plone/memoize/volatile.py M setup.py Repository: plone.memoize Branch: refs/heads/master Date: 2020-04-11T10:46:53+02:00 Author: Alessandro Pisa (ale-rt) <alessandro.pisa@gmail.com> Commit: plone/plone.memoize@0e94832 Merge pull request #18 from plone/17-black Make code black Files changed: A news/17.bugfix M bootstrap-buildout.py M plone/__init__.py M plone/memoize/compress.py M plone/memoize/forever.py M plone/memoize/instance.py M plone/memoize/interfaces.py M plone/memoize/ram.py M plone/memoize/request.py M plone/memoize/tests.py M plone/memoize/view.py M plone/memoize/volatile.py M setup.py
mister-roboto
pushed a commit
that referenced
this pull request
Sep 10, 2020
Branch: refs/heads/master Date: 2020-09-09T23:19:21+02:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.portlet.static@de7e19d Fixed invalid escape sequence Files changed: A news/3130.bugfix M plone/portlet/static/static.py Repository: plone.portlet.static Branch: refs/heads/master Date: 2020-09-09T23:23:16+02:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.portlet.static@c0ca159 Fixed deprecated assert functions in tests. Files changed: M plone/portlet/static/tests/test_portlet_static.py Repository: plone.portlet.static Branch: refs/heads/master Date: 2020-09-10T10:53:05+02:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/plone.portlet.static@6b09aec Merge pull request #18 from plone/maurits/fix-warnings-2 Fixed invalid escape sequence Files changed: A news/3130.bugfix M plone/portlet/static/static.py M plone/portlet/static/tests/test_portlet_static.py
mister-roboto
pushed a commit
that referenced
this pull request
Sep 10, 2020
Branch: refs/heads/master Date: 2020-09-09T23:19:21+02:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.portlet.static@de7e19d Fixed invalid escape sequence Files changed: A news/3130.bugfix M plone/portlet/static/static.py Repository: plone.portlet.static Branch: refs/heads/master Date: 2020-09-09T23:23:16+02:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.portlet.static@c0ca159 Fixed deprecated assert functions in tests. Files changed: M plone/portlet/static/tests/test_portlet_static.py Repository: plone.portlet.static Branch: refs/heads/master Date: 2020-09-10T10:53:05+02:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/plone.portlet.static@6b09aec Merge pull request #18 from plone/maurits/fix-warnings-2 Fixed invalid escape sequence Files changed: A news/3130.bugfix M plone/portlet/static/static.py M plone/portlet/static/tests/test_portlet_static.py
mister-roboto
pushed a commit
that referenced
this pull request
Sep 10, 2020
Branch: refs/heads/master Date: 2020-09-09T23:13:15+02:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/Products.MimetypesRegistry@d241e79 Fixed invalid escape sequences. Note that only some are for regular expressions (only one of them being reported as having an invalid escape sequence). The others are strings (well, bytes) used in a different way. It is very hard to see whether the magic mimetype changes are okay. For the first one, starting with 8BPS, for x-psd, I have found it in /usr/share/mime on Ubuntu 18.04, but even then I am not entirely sure it is correct. I could not find the others in there, but they do seem safer, as they are actually the same. For example: b'<smil\>' == br'<smil\>' Files changed: A news/3130.bugfix M Products/MimetypesRegistry/encoding.py M Products/MimetypesRegistry/mime_types/magic.py Repository: Products.MimetypesRegistry Branch: refs/heads/master Date: 2020-09-10T10:54:10+02:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/Products.MimetypesRegistry@89ff100 Merge pull request #18 from plone/maurits/fix-warnings Fixed invalid escape sequences. Files changed: A news/3130.bugfix M Products/MimetypesRegistry/encoding.py M Products/MimetypesRegistry/mime_types/magic.py
mister-roboto
pushed a commit
that referenced
this pull request
Sep 10, 2020
Branch: refs/heads/master Date: 2020-09-09T23:13:15+02:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/Products.MimetypesRegistry@d241e79 Fixed invalid escape sequences. Note that only some are for regular expressions (only one of them being reported as having an invalid escape sequence). The others are strings (well, bytes) used in a different way. It is very hard to see whether the magic mimetype changes are okay. For the first one, starting with 8BPS, for x-psd, I have found it in /usr/share/mime on Ubuntu 18.04, but even then I am not entirely sure it is correct. I could not find the others in there, but they do seem safer, as they are actually the same. For example: b'<smil\>' == br'<smil\>' Files changed: A news/3130.bugfix M Products/MimetypesRegistry/encoding.py M Products/MimetypesRegistry/mime_types/magic.py Repository: Products.MimetypesRegistry Branch: refs/heads/master Date: 2020-09-10T10:54:10+02:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/Products.MimetypesRegistry@89ff100 Merge pull request #18 from plone/maurits/fix-warnings Fixed invalid escape sequences. Files changed: A news/3130.bugfix M Products/MimetypesRegistry/encoding.py M Products/MimetypesRegistry/mime_types/magic.py
mister-roboto
pushed a commit
that referenced
this pull request
Oct 8, 2021
Branch: refs/heads/master Date: 2021-10-08T16:51:24+02:00 Author: Érico Andrei (ericof) <ericof@gmail.com> Commit: plone/plone.locking@780f9b6 Register a fallback @@plone_lock_info view to allow objects without plone.locking behavior to be edited. Files changed: A news/3331.fix A plone/locking/tests/test_views.py M plone/locking/browser/locking.py M plone/locking/configure.zcml Repository: plone.locking Branch: refs/heads/master Date: 2021-10-08T23:33:43+02:00 Author: Maurits van Rees (mauritsvanrees) <m.van.rees@zestsoftware.nl> Commit: plone/plone.locking@16f1321 Merge pull request #18 from plone/issue-3331-removing-lock-behavior Add fallback plone_lock_info view Files changed: A news/3331.fix A plone/locking/tests/test_views.py M plone/locking/browser/locking.py M plone/locking/configure.zcml
mister-roboto
pushed a commit
that referenced
this pull request
Oct 8, 2021
Branch: refs/heads/master Date: 2021-10-08T16:51:24+02:00 Author: Érico Andrei (ericof) <ericof@gmail.com> Commit: plone/plone.locking@780f9b6 Register a fallback @@plone_lock_info view to allow objects without plone.locking behavior to be edited. Files changed: A news/3331.fix A plone/locking/tests/test_views.py M plone/locking/browser/locking.py M plone/locking/configure.zcml Repository: plone.locking Branch: refs/heads/master Date: 2021-10-08T23:33:43+02:00 Author: Maurits van Rees (mauritsvanrees) <m.van.rees@zestsoftware.nl> Commit: plone/plone.locking@16f1321 Merge pull request #18 from plone/issue-3331-removing-lock-behavior Add fallback plone_lock_info view Files changed: A news/3331.fix A plone/locking/tests/test_views.py M plone/locking/browser/locking.py M plone/locking/configure.zcml
mister-roboto
pushed a commit
that referenced
this pull request
Oct 29, 2021
Branch: refs/heads/main Date: 2021-10-28T16:38:30+02:00 Author: Érico Andrei (ericof) <ericof@gmail.com> Commit: plone/plone.volto@07e9ecc Run tests with plone pip installation (buildout support is extensively tested by Jenkins. Files changed: M .github/workflows/tests.yml Repository: plone.volto Branch: refs/heads/main Date: 2021-10-28T16:44:58+02:00 Author: Érico Andrei (ericof) <ericof@gmail.com> Commit: plone/plone.volto@586a1a7 Fix Github action test Files changed: M .github/workflows/tests.yml Repository: plone.volto Branch: refs/heads/main Date: 2021-10-28T17:07:44+02:00 Author: Érico Andrei (ericof) <ericof@gmail.com> Commit: plone/plone.volto@b82a3be Fix Github Actions test path Files changed: M .github/workflows/tests.yml Repository: plone.volto Branch: refs/heads/main Date: 2021-10-28T17:11:55+02:00 Author: Érico Andrei (ericof) <ericof@gmail.com> Commit: plone/plone.volto@a5f8919 Add requirements folder to be used with pip installations. Files changed: A requirements/dev.txt A requirements/plone-5.2.txt A requirements/plone-6.0.txt A requirements/prod.txt Repository: plone.volto Branch: refs/heads/main Date: 2021-10-28T17:13:23+02:00 Author: Érico Andrei (ericof) <ericof@gmail.com> Commit: plone/plone.volto@aa3e93e Update Changelog. Files changed: M CHANGES.rst Repository: plone.volto Branch: refs/heads/main Date: 2021-10-28T17:29:44+02:00 Author: Érico Andrei (ericof) <ericof@gmail.com> Commit: plone/plone.volto@f13cb65 Remove unused .cache/plone Files changed: M .github/workflows/tests.yml Repository: plone.volto Branch: refs/heads/main Date: 2021-10-28T17:33:22+02:00 Author: Érico Andrei (ericof) <ericof@gmail.com> Commit: plone/plone.volto@2281b9c We do not need to hash requirements/dev.txt Files changed: M .github/workflows/tests.yml Repository: plone.volto Branch: refs/heads/main Date: 2021-10-29T11:34:18+02:00 Author: Érico Andrei (ericof) <ericof@gmail.com> Commit: plone/plone.volto@295c924 Merge pull request #18 from plone/plone-pip Setup tests with Plone installed with Pip Files changed: A requirements/dev.txt A requirements/plone-5.2.txt A requirements/plone-6.0.txt A requirements/prod.txt M .github/workflows/tests.yml M CHANGES.rst
mister-roboto
pushed a commit
that referenced
this pull request
Dec 22, 2021
Branch: refs/heads/master Date: 2021-12-22T10:56:38+01:00 Author: Peter Mathis (petschki) <peter.mathis@kombinat.at> Commit: plone/plone.app.debugtoolbar@5354e86 Fix missing zcml directive when plone.app.standardtiles is installed fixes #18 Files changed: A news/18.bugfix M src/plone/app/debugtoolbar/browser/configure.zcml Repository: plone.app.debugtoolbar Branch: refs/heads/master Date: 2021-12-22T15:00:50+01:00 Author: Peter Mathis (petschki) <petschki@users.noreply.github.com> Commit: plone/plone.app.debugtoolbar@39712c5 Merge pull request #29 from plone/issue-18 Fix missing zcml directive when plone.app.standardtiles is installed Files changed: A news/18.bugfix M src/plone/app/debugtoolbar/browser/configure.zcml
mister-roboto
pushed a commit
that referenced
this pull request
Dec 22, 2021
Branch: refs/heads/master Date: 2021-12-22T10:56:38+01:00 Author: Peter Mathis (petschki) <peter.mathis@kombinat.at> Commit: plone/plone.app.debugtoolbar@5354e86 Fix missing zcml directive when plone.app.standardtiles is installed fixes #18 Files changed: A news/18.bugfix M src/plone/app/debugtoolbar/browser/configure.zcml Repository: plone.app.debugtoolbar Branch: refs/heads/master Date: 2021-12-22T15:00:50+01:00 Author: Peter Mathis (petschki) <petschki@users.noreply.github.com> Commit: plone/plone.app.debugtoolbar@39712c5 Merge pull request #29 from plone/issue-18 Fix missing zcml directive when plone.app.standardtiles is installed Files changed: A news/18.bugfix M src/plone/app/debugtoolbar/browser/configure.zcml
mister-roboto
pushed a commit
that referenced
this pull request
Sep 8, 2022
Branch: refs/heads/main Date: 2022-09-07T15:36:52Z Author: Rudd-O (Rudd-O) <rudd-o@rudd-o.com> Commit: plone/plone.base@23708ce Fix folder_contents being broken with VHM and Multilingual When Multilingual is enabled and VHM is enabled too, serving any folderish's `folder_contents` under a language folder as a top level domain name is currently broken (if `en.site.com/archives` is VHMed to `PloneSite/en/archives` then `@@qsOptions` URL is `/archives/@@qsOptions` instead of being `/@@qsOptions` as it should be. The fundamental problem is that the function `get_top_site_from_url(...)` is failing to retrieve the actual top site because it can't find a site in the traversal structure, so it picks the last folderish as the site, which is obvs broken because `/@@qsOptions` only works on site roots, not on folderish content. This code makes it so that any site found in the structure is returned as the top site from the URL, but if no top site is found in that traversal, the actual site from `getSite()` is returned instead, which is the correct behavior based on how the function is named, and actually fixes the `/@@qsOptions` conundrum. Files changed: M src/plone/base/utils.py Repository: plone.base Branch: refs/heads/main Date: 2022-09-07T16:54:47Z Author: Rudd-O (Rudd-O) <rudd-o@rudd-o.com> Commit: plone/plone.base@4f88a01 Add towncrier announcement. Files changed: A news/18.bugfix Repository: plone.base Branch: refs/heads/main Date: 2022-09-07T17:42:57Z Author: Rudd-O (Rudd-O) <rudd-o@rudd-o.com> Commit: plone/plone.base@49a80b2 Include the topmost accessible object in the subsites list. Files changed: M src/plone/base/utils.py Repository: plone.base Branch: refs/heads/main Date: 2022-09-07T18:03:57Z Author: Rudd-O (Rudd-O) <rudd-o@rudd-o.com> Commit: plone/plone.base@60dcd49 Add comment to give context w.r.t p.a.multilingual. Files changed: M src/plone/base/utils.py Repository: plone.base Branch: refs/heads/main Date: 2022-09-07T18:19:35Z Author: Rudd-O (Rudd-O) <rudd-o@rudd-o.com> Commit: plone/plone.base@3199ddb Remove redundant comment. Files changed: M src/plone/base/utils.py Repository: plone.base Branch: refs/heads/main Date: 2022-09-07T19:16:33Z Author: Rudd-O (Rudd-O) <rudd-o@rudd-o.com> Commit: plone/plone.base@653bb70 Correct tests. Files changed: M src/plone/base/utils.py Repository: plone.base Branch: refs/heads/main Date: 2022-09-07T19:31:09Z Author: Rudd-O (Rudd-O) <rudd-o@rudd-o.com> Commit: plone/plone.base@b1ff114 Update tests to cover the test case that this PR fixes. Files changed: M src/plone/base/tests/test_utils.py Repository: plone.base Branch: refs/heads/main Date: 2022-09-07T21:29:14Z Author: Rudd-O (Rudd-O) <rudd-o@rudd-o.com> Commit: plone/plone.base@991cd48 Clarify comment in this crucial piece of code. Now that tests are passing and the functionality of the site is working perfectly, I give myself some time to give a better rationale for this change as comments, for future me and future Plonistas. Files changed: M src/plone/base/utils.py Repository: plone.base Branch: refs/heads/main Date: 2022-09-07T21:49:23Z Author: Rudd-O (Rudd-O) <rudd-o@rudd-o.com> Commit: plone/plone.base@a80196c Add warning to people who might want to use this function incorrectly. Files changed: M src/plone/base/utils.py Repository: plone.base Branch: refs/heads/main Date: 2022-09-07T21:51:58Z Author: Rudd-O (Rudd-O) <rudd-o@rudd-o.com> Commit: plone/plone.base@7d7da99 Change oneliner description of method, since it was misleading to begin with. Files changed: M src/plone/base/utils.py Repository: plone.base Branch: refs/heads/main Date: 2022-09-08T16:45:29Z Author: Rudd-O (Rudd-O) <rudd-o@rudd-o.com> Commit: plone/plone.base@1199d72 Merge pull request #18 from Rudd-O/main Fix folder_contents being broken with VHM and Multilingual ------------------------------ When Multilingual is enabled and VHM is enabled too, serving any folderish's `folder_contents` under a language folder as a top level domain name is currently broken (if `en.site.com/archives` is VHMed to `PloneSite/en/archives` then `@@qsOptions` URL is `/archives/@@qsOptions` instead of being `/@@qsOptions` as it should be. The fundamental problem is that the function `get_top_site_from_url(...)` is failing to retrieve the actual top site because it can't find a site in the traversal structure, so it picks the last folderish as the site, which is obvs broken because `/@@qsOptions` only works on site roots, not on folderish content. This code makes it so that any site found in the structure is returned as the top site from the URL, but if no top site is found in that traversal, the actual site from `getSite()` is returned instead, which is the correct behavior based on how the function is named, and actually fixes the `/@@qsOptions` conundrum. # Reproducer Odd intersection of circumstances to reproduce bug: 1. Create classic `Plone` site. 2. Enable Multilingual with `en-US` or some other language. 3. Verify visiting `/Plone` redirects to `Plone/en-US` or your language folder of choice. 4. VHM your site so that `/Plone/en-US` is accessible as `/` (a standard, supported Multilingual rewrite configuration typically used by Ploners for language-code subdomain hosting). `Plone/en-US/VirtualHostRoot` is the relevant VHM rewrite. 5. Visit the site. Verify that site is accessible as `/`. 6. Create folder `xxx` on that location. 7. Visit folder `xxx` on that location. 8. Click on *Folder contents* in the editor toolbar. 9. Verify that the folder contents screen for `xxx` loads, but the actual listing remains empty. 10. Verify that there is an HTTP 404 for `@@qsOptions` in the network panel of your browser inspector. # Rationale This code makes the method sometimes return a content object in some cases, rather than an actual site root. Why? All callsites (see below) need a "root object" *from the perspective of the browser* to compute a root and generate various URLs for their own purposes, because all their purposes are XHR browser stuff (fill lists of objects and search results, chiefly). This method I'm fixing determines the "root" used for that tree which is used in related items, image insertion, and folder contents browsing, and if that "root" is incorrect / does not correspond to what the browser sees as "root", **nothing works**. Needless to say, this method should never be used to traverse anything server-side. # Quality control ## Callsites My omelette is big. There are not that many uses, and all its uses currently broken are fixed by this patch. I count two uses: 1. `plone.app.content.browser.contents`:`ContentsBaseAction` / `get_options` / `ContextInfo.call` 2. `plone.app.widgets`:`get_relateditems_options` ## Unit and regression testing All current unit tests pass now. I have added a test case to cover the "root URL object is not actually a site" case, which was never tested before. In addition to that, I have tested this with a local build (most up to date code) and here is what I can verify: * Related items works now! * Image insertion works as well. * Browsing folders in folder contents works too. So pretty much everything that was broken before, is no longer broken thanks to this modest change. And that is the complete manual regression test of all users of this code. Files changed: A news/18.bugfix M src/plone/base/tests/test_utils.py M src/plone/base/utils.py
mister-roboto
pushed a commit
that referenced
this pull request
Mar 25, 2023
Branch: refs/heads/master Date: 2023-03-25T15:37:29+01:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.schema@9f121d6 Configuring with plone/meta Files changed: A .editorconfig A .meta.toml A .pre-commit-config.yaml A news/93ecbf56.internal A tox.ini M pyproject.toml M setup.cfg Repository: plone.schema Branch: refs/heads/master Date: 2023-03-25T15:38:30+01:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.schema@4a53c14 cleanup: remove old files Files changed: D buildout.cfg D versions.cfg Repository: plone.schema Branch: refs/heads/master Date: 2023-03-25T15:39:11+01:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.schema@315b88f chore: zpretty Files changed: M plone/schema/browser/templates/email_display.pt M plone/schema/browser/templates/uri_display.pt M plone/schema/configure.zcml Repository: plone.schema Branch: refs/heads/master Date: 2023-03-25T16:22:44+01:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.schema@f0de586 feat: codespell Files changed: M plone/schema/jsonfield.py Repository: plone.schema Branch: refs/heads/master Date: 2023-03-25T16:22:44+01:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.schema@1bf25f5 feat: pyroma Files changed: M setup.py Repository: plone.schema Branch: refs/heads/master Date: 2023-03-25T16:22:44+01:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.schema@e164543 feat: add extra flake8 configuration Files changed: M setup.cfg Repository: plone.schema Branch: refs/heads/master Date: 2023-03-25T16:22:44+01:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.schema@1199afe feat: configure z3c.dependencychecker Files changed: M pyproject.toml Repository: plone.schema Branch: refs/heads/master Date: 2023-03-25T16:22:44+01:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.schema@4cd5aff feat: declare dependencies Files changed: M setup.py Repository: plone.schema Branch: refs/heads/master Date: 2023-03-25T23:29:35+01:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/plone.schema@43a4dab Merge pull request #18 from plone/config-with-default-template-5c63531a Config with default template Files changed: A .editorconfig A .meta.toml A .pre-commit-config.yaml A news/93ecbf56.internal A tox.ini M plone/schema/browser/templates/email_display.pt M plone/schema/browser/templates/uri_display.pt M plone/schema/configure.zcml M plone/schema/jsonfield.py M pyproject.toml M setup.cfg M setup.py D buildout.cfg D versions.cfg
mister-roboto
pushed a commit
that referenced
this pull request
Apr 17, 2023
Branch: refs/heads/master Date: 2023-04-15T14:29:38+02:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.folder@217771a Configuring with plone/meta Files changed: A .editorconfig A .meta.toml A .pre-commit-config.yaml A news/5cc689e5.internal A tox.ini M pyproject.toml M setup.cfg Repository: plone.folder Branch: refs/heads/master Date: 2023-04-15T14:31:01+02:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.folder@3260c06 chore: pyupgrade Files changed: M src/plone/__init__.py M src/plone/folder/__init__.py M src/plone/folder/default.py M src/plone/folder/interfaces.py M src/plone/folder/nogopip.py M src/plone/folder/ordered.py M src/plone/folder/partial.py M src/plone/folder/testing.py M src/plone/folder/tests/benchmarks.py M src/plone/folder/tests/test_dict_interface.py M src/plone/folder/tests/test_integration.py M src/plone/folder/tests/test_ordering_adapters.py M src/plone/folder/tests/test_ordersupport.py M src/plone/folder/tests/test_partialordering.py M src/plone/folder/tests/test_unorderedordering.py M src/plone/folder/tests/test_webdav.py M src/plone/folder/tests/utils.py M src/plone/folder/unordered.py Repository: plone.folder Branch: refs/heads/master Date: 2023-04-15T14:31:13+02:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.folder@4aaab78 chore: isort Files changed: M setup.py M src/plone/folder/nogopip.py M src/plone/folder/ordered.py M src/plone/folder/partial.py M src/plone/folder/tests/test_integration.py M src/plone/folder/tests/test_partialordering.py M src/plone/folder/tests/test_unorderedordering.py Repository: plone.folder Branch: refs/heads/master Date: 2023-04-15T14:32:10+02:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.folder@1431f69 chore: black Files changed: M setup.py M src/plone/__init__.py M src/plone/folder/default.py M src/plone/folder/interfaces.py M src/plone/folder/nogopip.py M src/plone/folder/ordered.py M src/plone/folder/partial.py M src/plone/folder/testing.py M src/plone/folder/tests/benchmarks.py M src/plone/folder/tests/test_dict_interface.py M src/plone/folder/tests/test_integration.py M src/plone/folder/tests/test_ordering_adapters.py M src/plone/folder/tests/test_ordersupport.py M src/plone/folder/tests/test_partialordering.py M src/plone/folder/tests/test_unorderedordering.py M src/plone/folder/tests/test_webdav.py M src/plone/folder/tests/utils.py M src/plone/folder/unordered.py Repository: plone.folder Branch: refs/heads/master Date: 2023-04-15T14:32:29+02:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.folder@6d9d88b chore: zpretty Files changed: M src/plone/folder/configure.zcml Repository: plone.folder Branch: refs/heads/master Date: 2023-04-15T14:34:44+02:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.folder@2571b9c chore: update trove classifiers Files changed: M setup.py Repository: plone.folder Branch: refs/heads/master Date: 2023-04-15T14:34:54+02:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.folder@4ab8631 feat: pyroma Files changed: M setup.py Repository: plone.folder Branch: refs/heads/master Date: 2023-04-15T14:35:18+02:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.folder@0757ce3 feat: codespell Files changed: M CHANGES.rst Repository: plone.folder Branch: refs/heads/master Date: 2023-04-15T14:36:29+02:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.folder@9823864 feat: drop six usage Files changed: M setup.py M src/plone/folder/default.py M src/plone/folder/partial.py M src/plone/folder/tests/test_ordersupport.py Repository: plone.folder Branch: refs/heads/master Date: 2023-04-15T14:37:36+02:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.folder@808d296 feat: flake8 Files changed: M src/plone/folder/partial.py M src/plone/folder/tests/test_webdav.py Repository: plone.folder Branch: refs/heads/master Date: 2023-04-15T14:45:57+02:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.folder@7807a50 fix: code is inside src folder Files changed: M tox.ini Repository: plone.folder Branch: refs/heads/master Date: 2023-04-15T14:46:15+02:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.folder@ba99db5 feat: declare dependencies Files changed: M pyproject.toml M setup.py Repository: plone.folder Branch: refs/heads/master Date: 2023-04-15T15:36:25+02:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.folder@445178f Add news entry Files changed: A news/1.breaking Repository: plone.folder Branch: refs/heads/master Date: 2023-04-17T18:13:32+02:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/plone.folder@cc9eeed Merge pull request #18 from plone/config-with-default-template-dc2e2aa0 Config with default template Files changed: A .editorconfig A .meta.toml A .pre-commit-config.yaml A news/1.breaking A news/5cc689e5.internal A tox.ini M CHANGES.rst M pyproject.toml M setup.cfg M setup.py M src/plone/__init__.py M src/plone/folder/__init__.py M src/plone/folder/configure.zcml M src/plone/folder/default.py M src/plone/folder/interfaces.py M src/plone/folder/nogopip.py M src/plone/folder/ordered.py M src/plone/folder/partial.py M src/plone/folder/testing.py M src/plone/folder/tests/benchmarks.py M src/plone/folder/tests/test_dict_interface.py M src/plone/folder/tests/test_integration.py M src/plone/folder/tests/test_ordering_adapters.py M src/plone/folder/tests/test_ordersupport.py M src/plone/folder/tests/test_partialordering.py M src/plone/folder/tests/test_unorderedordering.py M src/plone/folder/tests/test_webdav.py M src/plone/folder/tests/utils.py M src/plone/folder/unordered.py
mister-roboto
pushed a commit
that referenced
this pull request
May 2, 2023
Branch: refs/heads/master Date: 2023-05-01T22:52:53Z Author: pre-commit-ci[bot] (pre-commit-ci[bot]) <66853113+pre-commit-ci[bot]@users.noreply.github.com> Commit: plone/plone.stringinterp@dba50b4 [pre-commit.ci] pre-commit autoupdate updates: - [github.com/asottile/pyupgrade: v3.3.1 → v3.3.2](asottile/pyupgrade@v3.3.1...v3.3.2) - [github.com/collective/zpretty: 3.0.3 → 3.0.4](collective/zpretty@3.0.3...3.0.4) Files changed: M .pre-commit-config.yaml Repository: plone.stringinterp Branch: refs/heads/master Date: 2023-05-02T16:23:49+02:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.stringinterp@26f23e1 Merge pull request #18 from plone/pre-commit-ci-update-config [pre-commit.ci] pre-commit autoupdate Files changed: M .pre-commit-config.yaml
mister-roboto
pushed a commit
that referenced
this pull request
Jan 3, 2024
Branch: refs/heads/master Date: 2024-01-01T18:30:15Z Author: pre-commit-ci[bot] (pre-commit-ci[bot]) <66853113+pre-commit-ci[bot]@users.noreply.github.com> Commit: plone/plone.indexer@326dee5 [pre-commit.ci] pre-commit autoupdate updates: - [github.com/pycqa/isort: 5.12.0 → 5.13.2](PyCQA/isort@5.12.0...5.13.2) - [github.com/psf/black: 23.11.0 → 23.12.1](psf/black@23.11.0...23.12.1) Files changed: M .pre-commit-config.yaml Repository: plone.indexer Branch: refs/heads/master Date: 2024-01-03T09:27:20+01:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.indexer@a1c08f7 Merge pull request #18 from plone/pre-commit-ci-update-config [pre-commit.ci] pre-commit autoupdate [city-skip] Files changed: M .pre-commit-config.yaml
mister-roboto
pushed a commit
that referenced
this pull request
Jan 3, 2024
Branch: refs/heads/master Date: 2024-01-01T18:30:15Z Author: pre-commit-ci[bot] (pre-commit-ci[bot]) <66853113+pre-commit-ci[bot]@users.noreply.github.com> Commit: plone/plone.indexer@326dee5 [pre-commit.ci] pre-commit autoupdate updates: - [github.com/pycqa/isort: 5.12.0 → 5.13.2](PyCQA/isort@5.12.0...5.13.2) - [github.com/psf/black: 23.11.0 → 23.12.1](psf/black@23.11.0...23.12.1) Files changed: M .pre-commit-config.yaml Repository: plone.indexer Branch: refs/heads/master Date: 2024-01-03T09:27:20+01:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.indexer@a1c08f7 Merge pull request #18 from plone/pre-commit-ci-update-config [pre-commit.ci] pre-commit autoupdate [city-skip] Files changed: M .pre-commit-config.yaml
mister-roboto
pushed a commit
that referenced
this pull request
Jan 3, 2024
Branch: refs/heads/master Date: 2024-01-01T18:29:56Z Author: pre-commit-ci[bot] (pre-commit-ci[bot]) <66853113+pre-commit-ci[bot]@users.noreply.github.com> Commit: plone/plone.caching@db3ece6 [pre-commit.ci] pre-commit autoupdate updates: - [github.com/pycqa/isort: 5.12.0 → 5.13.2](PyCQA/isort@5.12.0...5.13.2) - [github.com/psf/black: 23.11.0 → 23.12.1](psf/black@23.11.0...23.12.1) Files changed: M .pre-commit-config.yaml Repository: plone.caching Branch: refs/heads/master Date: 2024-01-03T09:33:45+01:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.caching@c2eafe6 Merge pull request #18 from plone/pre-commit-ci-update-config [pre-commit.ci] pre-commit autoupdate [city-skip] Files changed: M .pre-commit-config.yaml
mister-roboto
pushed a commit
that referenced
this pull request
Jan 3, 2024
Branch: refs/heads/master Date: 2024-01-01T18:29:56Z Author: pre-commit-ci[bot] (pre-commit-ci[bot]) <66853113+pre-commit-ci[bot]@users.noreply.github.com> Commit: plone/plone.caching@db3ece6 [pre-commit.ci] pre-commit autoupdate updates: - [github.com/pycqa/isort: 5.12.0 → 5.13.2](PyCQA/isort@5.12.0...5.13.2) - [github.com/psf/black: 23.11.0 → 23.12.1](psf/black@23.11.0...23.12.1) Files changed: M .pre-commit-config.yaml Repository: plone.caching Branch: refs/heads/master Date: 2024-01-03T09:33:45+01:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.caching@c2eafe6 Merge pull request #18 from plone/pre-commit-ci-update-config [pre-commit.ci] pre-commit autoupdate [city-skip] Files changed: M .pre-commit-config.yaml
mister-roboto
pushed a commit
that referenced
this pull request
Apr 22, 2024
Branch: refs/heads/master Date: 2024-01-23T16:58:40+01:00 Author: Philip Bauer (pbauer) <bauer@starzel.de> Commit: plone/plone.reload@8160357 Try to add support for Python 3.12 Files changed: M plone/reload/code.py M plone/reload/xreload.py Repository: plone.reload Branch: refs/heads/master Date: 2024-01-23T17:00:55+01:00 Author: Philip Bauer (pbauer) <bauer@starzel.de> Commit: plone/plone.reload@65d6c5d add classifier and changenote Files changed: M CHANGES.rst M setup.py Repository: plone.reload Branch: refs/heads/master Date: 2024-01-24T12:18:43+01:00 Author: Philip Bauer (pbauer) <bauer@starzel.de> Commit: plone/plone.reload@958bab3 drop six Files changed: M plone/reload/browser.py M plone/reload/code.py M plone/reload/interfaces.py M plone/reload/template.py M plone/reload/xreload.py M plone/reload/zcml.py M setup.py Repository: plone.reload Branch: refs/heads/master Date: 2024-04-22T11:58:37+02:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.reload@cbdbb58 Merge pull request #18 from plone/python312 Add Support for Python 3.12 and drop Python 2 Support Files changed: M CHANGES.rst M plone/reload/browser.py M plone/reload/code.py M plone/reload/interfaces.py M plone/reload/template.py M plone/reload/xreload.py M plone/reload/zcml.py M setup.py
mister-roboto
pushed a commit
that referenced
this pull request
Apr 22, 2024
Branch: refs/heads/master Date: 2024-01-23T16:58:40+01:00 Author: Philip Bauer (pbauer) <bauer@starzel.de> Commit: plone/plone.reload@8160357 Try to add support for Python 3.12 Files changed: M plone/reload/code.py M plone/reload/xreload.py Repository: plone.reload Branch: refs/heads/master Date: 2024-01-23T17:00:55+01:00 Author: Philip Bauer (pbauer) <bauer@starzel.de> Commit: plone/plone.reload@65d6c5d add classifier and changenote Files changed: M CHANGES.rst M setup.py Repository: plone.reload Branch: refs/heads/master Date: 2024-01-24T12:18:43+01:00 Author: Philip Bauer (pbauer) <bauer@starzel.de> Commit: plone/plone.reload@958bab3 drop six Files changed: M plone/reload/browser.py M plone/reload/code.py M plone/reload/interfaces.py M plone/reload/template.py M plone/reload/xreload.py M plone/reload/zcml.py M setup.py Repository: plone.reload Branch: refs/heads/master Date: 2024-04-22T11:58:37+02:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.reload@cbdbb58 Merge pull request #18 from plone/python312 Add Support for Python 3.12 and drop Python 2 Support Files changed: M CHANGES.rst M plone/reload/browser.py M plone/reload/code.py M plone/reload/interfaces.py M plone/reload/template.py M plone/reload/xreload.py M plone/reload/zcml.py M setup.py
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
added test for Change State button