-----Original Message----- From: Evan Simpson [mailto:evan@4-am.com] Sent: 26 November 1999 02:30 To: Martijn Faassen Cc: zope-dev@zope.org Subject: Re: [Zope-dev] Copy and paste is not working in custom folder product
Martijn Faassen wrote:
Thanks for this clue! I don't know what to do now, though. My .dtml files don't reside in subdirectories. Though it's very well possible it's due to some of the other odd stuff I do. :) How'd you change the way you loaded your .dtml files?
I changed
manage_addPythonMethodForm=HTMLFile('www/methodAdd', globals())
to
_www = os.path.join(package_home(globals()), 'www') manage_addPythonMethodForm=HTMLFile('methodAdd', _www)
All I can figure is that loading the HTMLFile with a pathname instead of a basename somehow caused the problem. Cheers,
Have a look at the html for the contents tab of a folderish objects where you can add your object, and see what method is going to be called. I guess it will be something like.... <OPTION value="manage_addProduct/YourProduct/www/methodAdd">Whatever ...for your original version, and... <OPTION value="manage_addProduct/YourProduct/methodAdd">Whatever ...for the new. This happens because it's using the object's __name__ attribute, which unexpectedly includes a / in the first example. A cleaner solution to the problem is..... manage_addPythonMethodForm=HTMLFile('www/methodAdd', globals(), __name__='methodAdd') However, I don't think its related to copy/paste problems :-(