Sometimes reverting pages fails with "CMSPlugin matching query does not exist." #255

Closed
bzed opened this Issue Nov 18, 2009 · 8 comments

Comments

Projects
None yet
4 participants
Contributor

bzed commented Nov 18, 2009

Sometimes reverting pages fails with "CMSPlugin matching query does not exist.", unfortunately I'm not able (yet) to provide an easy way to reproduce this. Saving pages and reverting random page states triggers the bug at some point....


Environment:

Request Method: POST
Request URL: https://hostname:port/admin/cms/page/117/history/3029/?language=de&
Django Version: 1.1.1
Python Version: 2.5.2
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.admin',
 'django.contrib.sitemaps',
 'django.contrib.markup',
 'django.contrib.sites',
 'django.contrib.admindocs.urls',
 'cms',
 'publisher',
 'cms.plugins.file',
 'cms.plugins.flash',
 'cms.plugins.googlemap',
 'cms.plugins.link',
 'cms.plugins.picture',
 'cms.plugins.snippet',
 'cms.plugins.teaser',
 'cms.plugins.text',
 'cms.plugins.twitter',
 'cms.plugins.video',
 'mptt',
 'reversion',
 'debug_toolbar',
 'filebrowser',
 'cmsplugin_news',
 'credativ.cmsplugin_contactform',
 'formfieldset',
 'honeypot',
 'haystack']
Installed Middleware:
('django.middleware.cache.UpdateCacheMiddleware',
 'django.middleware.gzip.GZipMiddleware',
 'honeypot.middleware.HoneypotMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.http.ConditionalGetMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.doc.XViewMiddleware',
 'cms.middleware.user.CurrentUserMiddleware',
 'cms.middleware.page.CurrentPageMiddleware',
 'django.middleware.cache.FetchFromCacheMiddleware',
 'debug_toolbar.middleware.DebugToolbarMiddleware')


Traceback:
File "/srv/website/de/prod/pylib/django/core/handlers/base.py" in get_response
  92.                 response = callback(request, *callback_args, **callback_kwargs)
File "/srv/website/de/prod/pylib/django/views/decorators/cache.py" in _wrapped_view_func
  44.         response = view_func(request, *args, **kwargs)
File "/srv/website/de/prod/pylib/django/contrib/admin/sites.py" in inner
  186.             return view(request, *args, **kwargs)
File "/srv/website/de/prod/pylib/cms/admin/pageadmin.py" in revision_view
  659.         return super(PageAdmin, self).revision_view(request, object_id, version_id, extra_context)
File "/srv/website/de/prod/pylib/django/db/transaction.py" in _commit_on_success
  240.                 res = func(*args, **kw)
File "/srv/website/de/prod/pylib/reversion/revisions.py" in _create_on_success
  304.                     result = func(*args, **kwargs)
File "/srv/website/de/prod/pylib/reversion/admin.py" in revision_view
  283.         return self.render_revision_form(request, obj, version, context, revert=True)
File "/srv/website/de/prod/pylib/cms/admin/pageadmin.py" in render_revision_form
  690.             revert_plugins(request, version.pk, obj)
File "/srv/website/de/prod/pylib/cms/admin/views.py" in revert_plugins
  287.         plugin.save()
File "/srv/website/de/prod/pylib/cms/models/pluginmodel.py" in save
  137.             super(CMSPlugin, self).save()
File "/srv/website/de/prod/pylib/django/db/models/base.py" in save
  410.         self.save_base(force_insert=force_insert, force_update=force_update)
File "/srv/website/de/prod/pylib/publisher/models.py" in save_base
  59.         ret = super(Publisher, self).save_base(*args, **kwargs)
File "/srv/website/de/prod/pylib/django/db/models/base.py" in save_base
  432.             signals.pre_save.send(sender=origin, instance=self, raw=raw)
File "/srv/website/de/prod/pylib/django/dispatch/dispatcher.py" in send
  166.             response = receiver(signal=self, sender=sender, **named)
File "/srv/website/de/prod/pylib/mptt/signals.py" in pre_save
  91.     parent = getattr(instance, opts.parent_attr)
File "/srv/website/de/prod/pylib/django/db/models/fields/related.py" in __get__
  257.                 rel_obj = QuerySet(self.field.rel.to).get(**params)
File "/srv/website/de/prod/pylib/django/db/models/query.py" in get
  305.                     % self.model._meta.object_name)

Exception Type: DoesNotExist at /admin/cms/page/117/history/3029/
Exception Value: CMSPlugin matching query does not exist.
Member

digi604 commented Nov 18, 2009

is this with moderation=True?

Contributor

bzed commented Nov 18, 2009

Yes, moderation is enabled.

Member

digi604 commented Nov 18, 2009

seams to be an mptt problem. Does this happen with only with TextPlugins?

Member

digi604 commented Nov 24, 2009

can't reproduce. I need a detailed description of this problem

Member

digi604 commented Nov 24, 2009

closed by d90fe7f child plugins are saved before mptt signals are fired

@christianbertschy christianbertschy pushed a commit to christianbertschy/django-cms-2.0 that referenced this issue Oct 1, 2012

@digi604 digi604 fixes #255 child plugins are saved before mptt signals are fired d90fe7f

macolo commented Jun 16, 2016

I can reproduce this on DjangoCMS 3.3 when an AliasPlugin is created and this is then reverted:

This is what's happening:

image

image

macolo commented Jun 16, 2016

@christianbertschy please reopen or should we open a new issue for this?

Owner

czpython commented Jun 16, 2016

@macolo I've opened a new ticket. Thanks!

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment