Image.tag() no longer publishable?
I used to be able to browse to an image's tag method and see its output in my browser. This worked in zope 2.6.1 and apparently stopped working in 2.6.2. Anybody know why? I don't see ANY changes to Image.py between 2.6.1 and 2.6.2. In 2.6.2, 2.6.4, and 2.7.0 I get the "missing docstring" error: "The object at http://localhost:8080/foo.jpg/tag has an empty or missing docstring. Objects must have a docstring to be published." Well, that's a bald-faced lie... Image.tag has a nice long docstring! What the heck? Is this maybe a side-effect of a security fix somewhere else? It's very inconvenient, I used this technique to embed zope images in JSP's and all those pages are now broken. Any clue would be appreciated. -- Paul Winkler http://www.slinkp.com Look! Up in the sky! It's SUBORDINATE FROM IDAHO! (random hero from isometric.spaceninja.com)
On Thu, Mar 04, 2004 at 04:38:46PM -0500, Paul Winkler wrote: | It's very inconvenient, I used this technique to embed zope images | in JSP's and all those pages are now broken. | Any clue would be appreciated. Wild guess: does the Image class have a docstring? -- Sidnei da Silva <sidnei@awkly.org> http://awkly.org - dreamcatching :: making your dreams come true http://plone.org/about/team#dreamcatcher Don't hit the keys so hard, it hurts.
On Thu, Mar 04, 2004 at 07:12:32PM -0300, Sidnei da Silva wrote:
On Thu, Mar 04, 2004 at 04:38:46PM -0500, Paul Winkler wrote: | It's very inconvenient, I used this technique to embed zope images | in JSP's and all those pages are now broken. | Any clue would be appreciated.
Wild guess: does the Image class have a docstring?
That was indeed a wild guess ;-) Of course it does. -- Paul Winkler http://www.slinkp.com Look! Up in the sky! It's INDUSTRIALIST BIMBO! (random hero from isometric.spaceninja.com)
| That was indeed a wild guess ;-) | Of course it does. Are you using Plone? Maybe it's monkey patching Image.tag. -- Sidnei da Silva <sidnei@awkly.org> http://awkly.org - dreamcatching :: making your dreams come true http://plone.org/about/team#dreamcatcher 1: No code table for op: ++post
On Thu, Mar 04, 2004 at 08:43:35PM -0300, Sidnei da Silva wrote:
| That was indeed a wild guess ;-) | Of course it does.
Are you using Plone? Maybe it's monkey patching Image.tag.
You were lurking on #zope weren't you ;-) -- Paul Winkler http://www.slinkp.com Look! Up in the sky! It's INSANE KING NAZI! (random hero from isometric.spaceninja.com)
On Thu, 2004-03-04 at 16:38, Paul Winkler wrote:
In 2.6.2, 2.6.4, and 2.7.0 I get the "missing docstring" error:
"The object at http://localhost:8080/foo.jpg/tag has an empty or missing docstring. Objects must have a docstring to be published."
I have seen this message being raised in many places "falsely", at least in Zope 2.7.0+. I haven't found the cause. It doesn't mean what it says it means in these cases, but it does always seem to mean that your security is fucked up somehow and what you're trying to do isn't allowed. - C
On Thu, Mar 04, 2004 at 05:14:37PM -0500, Chris McDonough wrote:
On Thu, 2004-03-04 at 16:38, Paul Winkler wrote:
In 2.6.2, 2.6.4, and 2.7.0 I get the "missing docstring" error:
"The object at http://localhost:8080/foo.jpg/tag has an empty or missing docstring. Objects must have a docstring to be published."
I have seen this message being raised in many places "falsely", at least in Zope 2.7.0+. I haven't found the cause. It doesn't mean what it says it means in these cases, but it does always seem to mean that your security is fucked up somehow and what you're trying to do isn't allowed.
I don't see how *my* security, per se, could be fscked up in this case... I get the error even logged in as Manager, and even if the image has all permissions for anonymous. time for a pdb session... so far all I've found is that, indeed, app.some_folder.some_image.tag has no docstring! Bizarre because I can see it in the sources. It appears that the error means something pretty close to what it says it means :-P More digging to follow ... -- Paul Winkler http://www.slinkp.com Look! Up in the sky! It's IMPENDING WIGGED-TOMATO! (random hero from isometric.spaceninja.com)
On Thu, Mar 04, 2004 at 06:10:18PM -0500, Paul Winkler wrote:
On Thu, Mar 04, 2004 at 05:14:37PM -0500, Chris McDonough wrote:
On Thu, 2004-03-04 at 16:38, Paul Winkler wrote:
In 2.6.2, 2.6.4, and 2.7.0 I get the "missing docstring" error:
"The object at http://localhost:8080/foo.jpg/tag has an empty or missing docstring. Objects must have a docstring to be published."
(snip) Forget all the preceding... I found the real culprit. Somebody in Plone monkey-patched OFS.Image.tag and didn't provide a docstring :-P Fix should be in the next Plone 2.0 RC or final. "BAD MONKEY! NO BANANA!" - slinkP on #zope, 3/04/04
If you're using Plone, it monkeypatches Image.tag(). Caused me to add an Image.pil_tag() monkeypatch to my monkeypatch ImageTag_CorePatch :) On Thursday, March 4, 2004, at 04:38 PM, Paul Winkler wrote:
I used to be able to browse to an image's tag method and see its output in my browser. This worked in zope 2.6.1 and apparently stopped working in 2.6.2. Anybody know why? I don't see ANY changes to Image.py between 2.6.1 and 2.6.2.
In 2.6.2, 2.6.4, and 2.7.0 I get the "missing docstring" error:
"The object at http://localhost:8080/foo.jpg/tag has an empty or missing docstring. Objects must have a docstring to be published."
Well, that's a bald-faced lie... Image.tag has a nice long docstring! What the heck? Is this maybe a side-effect of a security fix somewhere else?
It's very inconvenient, I used this technique to embed zope images in JSP's and all those pages are now broken. Any clue would be appreciated.
--
Paul Winkler http://www.slinkp.com Look! Up in the sky! It's SUBORDINATE FROM IDAHO! (random hero from isometric.spaceninja.com)
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Marc Lindahl wrote:
If you're using Plone, it monkeypatches Image.tag(). Caused me to add an Image.pil_tag() monkeypatch to my monkeypatch ImageTag_CorePatch :)
Oh I wish we could get that into Zope so it actually puts out an image tag *by default* without a border. Sigh. -- Andy McKay ClearWind Consulting http://www.clearwind.ca
I changed ImageTag_CorePatch to also do the border=0 default patch..... On Thursday, March 4, 2004, at 08:26 PM, Andy McKay wrote:
Marc Lindahl wrote:
If you're using Plone, it monkeypatches Image.tag(). Caused me to add an Image.pil_tag() monkeypatch to my monkeypatch ImageTag_CorePatch :)
Oh I wish we could get that into Zope so it actually puts out an image tag *by default* without a border. Sigh. -- Andy McKay ClearWind Consulting http://www.clearwind.ca
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
On Thu, Mar 04, 2004 at 05:26:59PM -0800, Andy McKay wrote:
Marc Lindahl wrote:
If you're using Plone, it monkeypatches Image.tag(). Caused me to add an Image.pil_tag() monkeypatch to my monkeypatch ImageTag_CorePatch :)
Oh I wish we could get that into Zope so it actually puts out an image tag *by default* without a border. Sigh.
Eh? I'm not sure what you want. No border attribute, or border="0"?
From OFS.Image.tag in zope 2.7.0:
if not 'border' in [ x.lower() for x in args.keys()]: result = '%s border="0"' % result ... that's been in there for about 3 years! If you want to force no border attribute, you can pass it a false value. Plone does the opposite - the monkeypatch causes there to be no border attribute unless you ask for one. So you leave it out and then you wrap your image in an <a> tag and every freakin' browser puts a border around it. Blah. I prefer Zope's default to Plone's. -- Paul Winkler http://www.slinkp.com Look! Up in the sky! It's INTER PUERILE NAMETAG FARMER! (random hero from isometric.spaceninja.com)
Paul Winkler wrote:
Eh? I'm not sure what you want. No border attribute, or border="0"? [snip] If you want to force no border attribute, you can pass it a false value.
No border attribute at all. In Zope you have to specify you dont want a border you have to call <tal:image replace="python: here.some_jpg.tag(border=0)">. What we want to do in Plone is this: <tal:image replace="here/some_jpg">. Much easier, more readable and probably faster.
Plone does the opposite - the monkeypatch causes there to be no border attribute unless you ask for one.
Right because the border attribute is not standards compliant, and is deprecated. So this way if you don't want to meet standards, great go fo it, but otherwise you'll get the right tag. For more information on that, ask the Plone UI guys they were the ones who asked me to do this somehow. Borders should only be done in CSS.
So you leave it out and then you wrap your image in an <a> tag and every freakin' browser puts a border around it. Blah. I prefer Zope's default to Plone's.
That's what CSS is for and that's why it will probably never go into the core - let's break everyone's images folks... -- Andy McKay ClearWind Consulting http://www.clearwind.ca
On Thu, Mar 04, 2004 at 07:25:02PM -0800, Andy McKay wrote:
Right because the border attribute is not standards compliant, and is deprecated. So this way if you don't want to meet standards, great go fo it, but otherwise you'll get the right tag.
Oh ok, I didn't know that about it being deprecated. Figures.
That's what CSS is for and that's why it will probably never go into the core - let's break everyone's images folks...
yeah, it might be an unpopular change. I dunno. Anything that forces me to use better style is OK with me ;-) -- Paul Winkler http://www.slinkp.com Look! Up in the sky! It's MULTI-HOPPING MOUSE GEORGE! (random hero from isometric.spaceninja.com)
Paul Winkler wrote:
yeah, it might be an unpopular change. I dunno. Anything that forces me to use better style is OK with me ;-)
Ideally we need to set a zope config option that states what HTML standard is being rendered too, then all parts that render HTML use those conventions. We've found this in Plone where some underlying bit of code somewhere in the bowels renders a query string incorrectly for example. Not a trivial job though and probably not worth it. Would also give people who run virtual hosting with multiple sites a bit of a fit. -- Andy McKay ClearWind Consulting http://www.clearwind.ca
On Thursday, March 4, 2004, at 10:14 PM, Paul Winkler wrote:
From OFS.Image.tag in zope 2.7.0:
if not 'border' in [ x.lower() for x in args.keys()]: result = '%s border="0"' % result
... that's been in there for about 3 years! If you want to force no border attribute, you can pass it a false value.
That's similar to mine: if not 'border' in map(string.lower, args.keys()): result = '%s border="0"' % result ...but yeah, CSS is better....
participants (5)
-
Andy McKay -
Chris McDonough -
Marc Lindahl -
Paul Winkler -
Sidnei da Silva