nephila / djangocms-page-meta

OpenGraph, Twitter Card and Google+ snippet tags for django CMS 3 pages
https://djangocms-page-meta.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
59 stars 64 forks source link

Publishing causes "extra" GenericMetaAttributes to be copied without regard for deletion #72

Closed djkazic closed 6 years ago

djkazic commented 7 years ago

In the copy_relations function for TitleMeta, the oldinstance extra.all() is copied over to the new instance without checking if the item has been deleted.

The result is that when a GenericMetaAttribute is deleted under Meta -> language and the page it references is published, it continues to be rendered anyway. The only way to remove it is to filter the GenericMetaAttribute objects using the ORM and call delete().

OS: Ubuntu 16.04 x64 Django: 1.8.x stable Django-CMS: 3.2.x stable djangocms-page-meta: 0.6.3

A possible patch is to change copy_relations to check object existence through the ORM before copying it to the new instance during the publish operation. I have submitted a PR with this change here: https://github.com/nephila/djangocms-page-meta/pull/71

yakky commented 6 years ago

Fixed by #71