CCK block not displaying if ampersand entities are used in links contained in block

escoles - April 20, 2009 - 14:04
Project:CCK Blocks
Version:6.x-1.1
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

I am using CCK Blocks in conjunction with a CCK field to display content in the sidebar of the page.

This is one of three sites I've either built or am working on that implement side content in this way. On one production site and one site that's a littel behind this one in the dev pipeline, the field display settings for the CCK block look like this:

Label: hidden
Teaser: hidden
Exclude [teaser]: yes
Full node: hidden
Exclude [full node]: yes

On the site I'm currently working on, I've found that I must use these settings:

Label: hidden
Teaser: hidden
Exclude [teaser]: yes
Full node: hidden
Exclude [full node]: no

... which has the side effect that the Side Content is now included (albeit hidden) in the body of the page -- i.e., it's there twice.

Obviously I have a workaround, but there are two reasons this concerns me:

  1. It's the opposite of behavior for other sites, one with a nearly identical overall configuration, so I'm concerned about a deeper problem.
  2. Since I don't know why it's happening, I don't know if the behavior could change at the point of some random software upgrade.

Note that this only happens with the Webform content type. No other content types are affected. (On this site, the Webform type is also displaying some very odd behaviors: For example, can't position CCK fields reliably in the edit page.)

Drupal, CCK, CCK Blocks and Webform are all at the same version on the two sites I'm testing on this morning. (Two different clients with nearly identical software requirements, so I cloned one site -- on which CCK block display in the sidebar works -- to make the second.) I've scanned the update status and the only things not at the same version level are Views, Print, Panels, Mimedetect, ImageAPI, and Advanced Help -- I wouldn't expect any of those to be related to this, but I'm all ears.

#1

escoles - April 20, 2009 - 14:31
Priority:normal» critical

I spoke too soon. Un-setting "exclude" worked on the Development site on a test form, but did not work for the actual form. So I have no workaround. It's now kind of a critical issue, since this site goes live Friday non-negotiably.

Anybody have any ideas what the problem might be?

Will add results of further testing shortly.

#2

escoles - April 20, 2009 - 14:35

I have verified that the field is not being displayed at all on the problematic form. I.e., this is not an accident of page-specific stylesheet coding.

I have added characteristics to my test form to parallel those of the problematic form, but have not been able to make it fail.

I have cloned the problematic page, and it shows the same failure. So I can't simply clone my way out of this.

So far, problem is actually restricted to one form and its clones. Next step will be to systematically remove features from the cloned page.

#3

escoles - April 20, 2009 - 15:41
Title:CCK block not displaying on Webform pages unless 'exclude' unselected» CCK block not displaying if ampersand entities are used in links contained in block
Priority:critical» normal

This does not only affect Webforms. Changing subject accordingly.

This is related to input filters, but I don't yet know exactly how. If I change the input filter to "Filtered HTML", the blocks will be displayed. So this is probably not a CCK Blocks issue but rather a core input filters issue, and when I get a few minutes I'll re-post in the relevant venue. I'm leaving this open in case anyone here has any insights on this, or on the off chance that it really is a CCK Blocks issue. Changing status back to 'normal' on this issue because I don't think it's CCK Blocks.

Here's some testing I've done.

Introducing the following HTML code into the CCK field for side content causes the block to fail to be displayed on webforms:

<p>Email: <a href="mailto:[removed]">[removed]</a></p>
<p><a target="_blank" href="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=275+Lake+Avenue,+Rochester,+NY+14608&amp;sll=37.0625,-95.677068&amp;sspn=38.826758,71.191406&amp;ie=UTF8&amp;ll=43.170851,-77.62742&amp;spn=0.008748,0.017381&amp;z=16&amp;iwloc=r0">Get Directions.</a></p>

Note that either one of these elements is sufficient. Removing one or the other will not cause the block to be displayed, but removing both will. That's a very curious fact in the light of the (highly unstable) workaround I've developed.

If the code above is replaced by this code, the blocks will display:

<p>Email: <a href="mailto:[removed]">[removed]</a></p><p><a href="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=275+Lake+Avenue,+Rochester,+NY+14608&sll=37.0625,-95.677068&sspn=38.826758,71.191406&ie=UTF8&ll=43.170851,-77.62742&spn=0.008748,0.017381&z=16&iwloc=r0" target="_blank">Get Directions.</a></p>

Only difference is that the ampersand entities in the Google Maps link have been replaced with straight-up ampersands. So, clearly a filtering issue.

To be clear: When these blocks are not displayed, they are completely omitted from the sidebar. They are not displayed in a filtered form and they are not hidden. That says to me that what must be happening is that the block content is 'null' when the page is built. I didn't think filters were supposed to work that way, and I'm unclear on why that would happen only on Webforms and on no other content type. Anybody have any feedback on that?

What I'm not understanding is why the presence of ampersand entities in a URL (which is perfectly legal) simply blows up display of the whole block. Does anyone have any insight on that? Is it generally related to the known defects with htmlcorrector?

#4

escoles - April 20, 2009 - 16:46

Improvement on the workaround, in case anyone else is having this problem.

While there's clearly a filter problem (a lawful URL is breaking block display), it's only evident because of the way that FCKEditor replaces ampersands with ampersand entities.

First thing I did was disable FCKEditor in that particular field. That's a brute force approach.

After digging through the FCKEditor documentation, I found the configuration option to disable replacing ampersands with entities:

http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/C...

So now if I sanitize the URL, at least FCKEditor won't munge it. But I do still have to sanitize the URLs.

#5

Earl Grey - October 27, 2009 - 22:40

Where and how do you sanitize the URLs? If I get you right, the block disappears, if there is a &amp; in the content that is to be displayed in the block?

#7

Earl Grey - October 27, 2009 - 22:47

#8

Earl Grey - October 28, 2009 - 08:57
Status:active» postponed (maintainer needs more info)

Please check again with the current -dev release.

#9

Earl Grey - November 24, 2009 - 20:26
Status:postponed (maintainer needs more info)» fixed

Seems to be fixed, as there are no further comments.

#10

System Message - December 8, 2009 - 20:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.