|
|
|
|
Mark Phillips
()
|
|
||||||||||||
|
I have Plone-2.5.5 installed with as a zeocluster. I created two sites, one ahs and one ahs_dev. Each one has a separate data.fs file in separate directories. Each site has identical products. I added a python script to the Extensions directory under client1, client2, and skel. I am able to add the script as an external method in the ahs site and it works. When I try to add the same script as an external method in the ahs_dev site, I get a 404 Error - object not found. Why can't I add the external method to the second site? I even tried renaming the script and I still cannot add an external method to the second site. What am I doing wrong? Everything else works in the ahs_dev site.
Thanks, Mark _______________________________________________ Product-Developers mailing list [hidden email] http://lists.plone.org/mailman/listinfo/product-developers |
||||||||||||||
|
|
Maurits van Rees-3
()
|
|
||||||||||||
|
Mark Phillips, on 2009-09-01:
> > I have Plone-2.5.5 installed with as a zeocluster. I created two sites, one > ahs and one ahs_dev. Each one has a separate data.fs file in separate > directories. Each site has identical products. I added a python script to > the Extensions directory under client1, client2, and skel. I am able to add > the script as an external method in the ahs site and it works. When I try to > add the same script as an external method in the ahs_dev site, I get a 404 > Error - object not found. Why can't I add the external method to the second > site? I even tried renaming the script and I still cannot add an external > method to the second site. What am I doing wrong? Everything else works in > the ahs_dev site. Go to the error_log of ahs_dev, remove or #comment out the line with NotFound. Then try adding that external method again and see if that now gives you a proper traceback; hopefully that contains more hints. When you get a 404 on a page it is not always that page itself that cannot be found. Having said that, I *can* imagine that the separate Data.fs files are the cause for the problem here; if that is the case then I would call this a bug. -- Maurits van Rees | http://maurits.vanrees.org/ Work | http://zestsoftware.nl/ "This is your day, don't let them take it away." [Barlow Girl] _______________________________________________ Product-Developers mailing list [hidden email] http://lists.plone.org/mailman/listinfo/product-developers |
||||||||||||||
|
|
Mark Phillips
()
|
|
||||||||||||
|
Maurits,
Thanks for the pointer...I forgot about how the error log filters out certain errors. The error said that it could not find the method in my python file. Well, it is there. Then I realized I was cutting and pasting the ID, method name, etc. from the ahs site to the ahs_dev site. I inadvertently added a trailing space, so the method could not be found. I would call this a bug, since I believe a method name in python cannot have a trailing (or leading) spaces. In the traceback below, and you can see the trailing space in the method name that was picked up by the add external method form: Traceback (innermost last):If my understanding of python is correct, shouldn't manage_addExternalMethod stip off leading and trailing white space from the id, title, module, and function names passed into the method? In ExternalMethod, manage_addExternalMethod does this: id=str(id) title=str(title) module=str(module) function=str(function) should it be? id=str(id).strip() title=str(title).strip() module=str(module).strip() function=str(function).strip() Thanks again for shining a light on an otherwise murky road to understanding! How would I submit a bug report, if you think there is a bug here. Just a newbie trying to give back. Mark
On Tue, Sep 1, 2009 at 2:14 PM, Maurits van Rees <[hidden email]> wrote: Mark Phillips, on 2009-09-01: _______________________________________________ Product-Developers mailing list [hidden email] http://lists.plone.org/mailman/listinfo/product-developers |
||||||||||||||
|
|
Maurits van Rees-3
()
|
|
||||||||||||
|
Mark Phillips, on 2009-09-02:
> > Maurits, > > Thanks for the pointer...I forgot about how the error log filters out > certain errors. > > The error said that it could not find the method in my python file. Well, it > is there. Then I realized I was cutting and pasting the ID, method name, > etc. from the ahs site to the ahs_dev site. I inadvertently added a trailing > space, so the method could not be found. I would call this a bug, since I > believe a method name in python cannot have a trailing (or leading) spaces. > In the traceback below, and you can see the trailing space in the method > name that was picked up by the add external method form: > > Traceback (innermost last): > Module ZPublisher.Publish, line 115, in publish > Module ZPublisher.mapply, line 88, in mapply > Module ZPublisher.Publish, line 41, in call_object > Module Products.ExternalMethod.ExternalMethod, line 59, in > manage_addExternalMethod > Module Products.ExternalMethod.ExternalMethod, line 111, in __init__ > Module Products.ExternalMethod.ExternalMethod, line 134, in manage_edit > Module Products.ExternalMethod.ExternalMethod, line 141, in getFunction > Module App.Extensions, line 158, in getObject > - __traceback_info__: > ('/opt/Plone-2.5.5/zeocluster/client1/Extensions/WorkflowEmailScripts.py', > 'WorkflowEmailScripts') > NotFound: The specified object, <em>edit_new_content </em>, was not > found in module, <em>WorkflowEmailScripts</em>. > > If my understanding of python is correct, shouldn't manage_addExternalMethod > stip off leading and trailing white space from the id, title, module, and > function names passed into the method? In ExternalMethod, > manage_addExternalMethod does this: > id=str(id) > title=str(title) > module=str(module) > function=str(function) > > should it be? > id=str(id).strip() > title=str(title).strip() > module=str(module).strip() > function=str(function).strip() Such a change would make sense for me. > Thanks again for shining a light on an otherwise murky road to > understanding! How would I submit a bug report, if you think there is a bug > here. Just a newbie trying to give back. Products.ExternalMethod is part of Zope 2. The tracker for that is on launchpad: https://bugs.launchpad.net/zope2/ -- Maurits van Rees | http://maurits.vanrees.org/ Work | http://zestsoftware.nl/ "This is your day, don't let them take it away." [Barlow Girl] _______________________________________________ Product-Developers mailing list [hidden email] http://lists.plone.org/mailman/listinfo/product-developers |
||||||||||||||
|
|
Mark Phillips
()
|
|
||||||||||||
|
Thanks!
I added Bug #423171: to Zope 2. Cheers! Mark On Wed, Sep 2, 2009 at 12:22 AM, Maurits van Rees <[hidden email]> wrote: Mark Phillips, on 2009-09-02: _______________________________________________ Product-Developers mailing list [hidden email] http://lists.plone.org/mailman/listinfo/product-developers |
||||||||||||||
| Free Embeddable Forum Powered by Nabble | Help |