Commit d52bec53 authored by Amos Latteier's avatar Amos Latteier

Fixed a longstanding bug which prevented the help system from working with an...

Fixed a longstanding bug which prevented the help system from working with an existing product that was not help system aware. This should allow the help system to work correctly with existing Zope installations.
parent 5dd758f8
......@@ -87,6 +87,7 @@
from AccessControl.PermissionRole import PermissionRole
import Globals, os, OFS.ObjectManager, OFS.misc_, Products, OFS.PropertySheets
from HelpSys import HelpTopic
from HelpSys.HelpSystem import ProductHelp
import string, os.path
if not hasattr(Products, 'meta_types'): Products.meta_types=()
......@@ -265,6 +266,10 @@ class ProductContext:
"""
Register a Help Topic for a product.
"""
# make sure the product has a ProductHelp
if not hasattr(self.__prod, 'Help'):
self.__prod._setObject('Help',
ProductHelp('Help', '%s Help' % self.__prod.id))
self.__prod.__of__(self.__app.Control_Panel.Products).Help._setObject(id, topic)
......@@ -282,6 +287,10 @@ class ProductContext:
.stx .txt -- STXHelpTopic
.jpg .png .gif -- ImageHelpTopic
"""
# make sure the product has a ProductHelp
if not hasattr(self.__prod, 'Help'):
self.__prod._setObject('Help',
ProductHelp('Help', '%s Help' % self.__prod.id))
if clear:
help=self.__prod.__of__(self.__app.Control_Panel.Products).Help
for id in help.objectIds('Help Topic'):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment