CCK Links broken on node page, fine on views preview

Events happening in the community are now at Drupal community events on www.drupal.org.
Screenack's picture

I've crossed posted this to the CCK Links and Genesis theme issues pages. I'm not clear where the failure is but I seem to be unique in experiencing it. I would dearly appreciate any thoughts on resolving this issue; thanks! (Yes, I will follow up on my cross-posts; I'd hate to leave such a mess.)

Interestingly, I'm not seeing this issue outside of the Genesis theme and my subtheme; I only see the error when using those themes. The themes that ship with D7 DO NOT show the error.

Drupal 7.0
Views 7.x-3.0-alpha1
Link 7.x-1.x-dev

I have a view where I have included two fields: an image field and an associated link/URL field. I wish to have the image nest in an anchor tag to the associated site. For example, the first item in the list should output:

<div class="views-slideshow-cycle-main-frame-row-item views-row views-row-0 views-row-first views-row-odd">
  <a href="http://www.exturl.com" class="views-ajax-processed-processed">
    <div class="field field-name-field-co-logo field-type-image field-label-hidden">
      <div class="field-items">
<div class="field-item even">
  <img src="http://www.customersite.com/sites/default/files/styles/large/public/company-logos/exturl.gif" alt="" />
</div>
      </div>
    </div>
  </a>
</div>

and this is what I get in the preview of the views page for the view. Great (well, noisy, possibly invalid, but workable) However, when I go to the page (the view as a block, only display on this one page) I get this noise:
<div class="views-slideshow-cycle-main-frame-row-item views-row views-row-0 views-row-first views-row-odd">
  <a href="/%0A%20%20%20%20%20%20%20%20http%3A//www.exturl.com%0A%20%20">
    <div class="field field-name-field-co-logo field-type-image field-label-hidden">
      <div class="field field-name-field-co-logo field-type-image field-label-hidden">
<div class="field-items">
  <div class="field-item even">
    <img src="http://www.customersite.com/sites/default/files/styles/large/public/company-logos/exturl.gif" alt="" />
  </div>
</div>
      </div>
    </div>
  </a>
</div>

As you can see, there's a good deal of noise prefixed to the anchor tag, as well as inserted in the URL itself, and afterward.

How do I fix this?

AttachmentSize
logo-cycle-viewer.txt9 KB
module-list.txt5.23 KB

Comments

Hey Kyle, It looks to me like

JuliaKM's picture

Hey Kyle,

It looks to me like extra spaces are getting inserted into the link field. My best guess is that this is an issue with the block template in the Genesis theme, but that's a pretty wild guess. Can you take the block template file (block.tpl.php) from one of the base Drupal 7 themes that you know works and swap it out with the Genesis theme? If your block renders correctly after that, then at least we will have isolated the problem.

Also, I think it would be worth looking in the database to check if your link has any strange characters near it. It could be a database corruption issue or something related to the Link module not correctly validating.

Julia

Thanks for the suggestions!

Screenack's picture

Julia.

Great ideas worth checking out! Unfortunately, they didn't help fix the problem.

First I checked my database. The relevant data is without extra characters (also, when viewing the page using a non-genesis theme, say "Seven" the CCK Link works as expected.) I failed to make clear initially that the preview output and output from non-genesis themes works as I expect.

Second I copied modules/block/block.tpl.php (the only other non-genesis block handy) into my subtheme, cleared server cache, and reloaded the page. While the display was (expectedly) broken, the links remained "broken."

View?

JuliaKM's picture

Can you paste in your views export and write a list of installed modules? Also, I'm guessing that you're using Views and some sort of slideshow module but I don't know which one.

Additionally, does this happen with both your genesis subtheme and the master genesis module?

Julia

Added attachments

Screenack's picture

Much thanks for helping me with this!

I've attached
logo-cycle-viewer.txt 9 KB > views exported of affected view
module-list.txt 5.23 KB > list of enabled modules for the site

The attachments are to the first post of this thread

Yes, the views_slideshow module: Views Slideshow: Cycle (views_slideshow_cycle) 7.x-3.0-alpha1

Yes this problem is limited to the genesis theme and my derivative subtheme.

I wasn't able to reproduce

JuliaKM's picture

I wasn't able to reproduce the problem with the dev or alpha versions of views slideshow and the Genesis theme. Here's the view I created that worked fine. Can you attach an export of your content type? Maybe there's another field in there that's causing the problem. There's also the chance it's another module. Have you disabled everything other than what you need for the slideshow to test this?

$view = new view;
$view->name = 'slideshow_test';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'slideshow_test';
$view->core = 7;
$view->api_version = '3.0-alpha1';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially /

/
Display: Master /
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'slideshow_test';
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = '5';
$handler->display->display_options['style_plugin'] = 'slideshow';
$handler->display->display_options['row_plugin'] = 'fields';
/
Field: Content: Title /
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['label'] = '';
$handler->display->display_options['fields']['title']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['title']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['title']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['title']['alter']['trim'] = 0;
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = 0;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = 0;
$handler->display->display_options['fields']['title']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['title']['alter']['html'] = 0;
$handler->display->display_options['fields']['title']['hide_empty'] = 0;
$handler->display->display_options['fields']['title']['empty_zero'] = 0;
$handler->display->display_options['fields']['title']['link_to_node'] = 1;
/
Field: Content: Image /
$handler->display->display_options['fields']['field_image']['id'] = 'field_image';
$handler->display->display_options['fields']['field_image']['table'] = 'field_data_field_image';
$handler->display->display_options['fields']['field_image']['field'] = 'field_image';
/
Field: Content: Title /
$handler->display->display_options['fields']['title_1']['id'] = 'title_1';
$handler->display->display_options['fields']['title_1']['table'] = 'node';
$handler->display->display_options['fields']['title_1']['field'] = 'title';
/
Sort criterion: Content: Post date /
$handler->display->display_options['sorts']['created']['id'] = 'created';
$handler->display->display_options['sorts']['created']['table'] = 'node';
$handler->display->display_options['sorts']['created']['field'] = 'created';
$handler->display->display_options['sorts']['created']['order'] = 'DESC';
/
Filter criterion: Content: Published /
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 0;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/
Filter criterion: Content: Type /
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
  'article' => 'article',
);

/
Display: Block /
$handler = $view->new_display('block', 'Block', 'block');
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
$handler->display->display_options['style_plugin'] = 'slideshow';
$handler->display->display_options['style_options']['slideshow_type'] = 'views_slideshow_cycle';
$handler->display->display_options['style_options']['slideshow_skin'] = 'default';
$handler->display->display_options['style_options']['skin_info'] = array(
  'class' => 'default',
  'name' => 'Default',
  'module' => 'views_slideshow',
  'path' => '',
  'stylesheets' => array(),
);
$handler->display->display_options['style_options']['widgets']['top']['views_slideshow_pager']['weight'] = '1';
$handler->display->display_options['style_options']['widgets']['top']['views_slideshow_pager']['type'] = 'views_slideshow_pager_fields';
$handler->display->display_options['style_options']['widgets']['top']['views_slideshow_pager']['views_slideshow_pager_fields_fields'] = array(
  'field_link' => 0,
  'field_image' => 0,
);
$handler->display->display_options['style_options']['widgets']['top']['views_slideshow_controls']['weight'] = '1';
$handler->display->display_options['style_options']['widgets']['top']['views_slideshow_controls']['type'] = 'views_slideshow_controls_text';
$handler->display->display_options['style_options']['widgets']['top']['views_slideshow_slide_counter']['weight'] = '1';
$handler->display->display_options['style_options']['widgets']['bottom']['views_slideshow_pager']['weight'] = '1';
$handler->display->display_options['style_options']['widgets']['bottom']['views_slideshow_pager']['type'] = 'views_slideshow_pager_fields';
$handler->display->display_options['style_options']['widgets']['bottom']['views_slideshow_pager']['views_slideshow_pager_fields_fields'] = array(
  'field_link' => 0,
  'field_image' => 0,
);
$handler->display->display_options['style_options']['widgets']['bottom']['views_slideshow_controls']['weight'] = '1';
$handler->display->display_options['style_options']['widgets']['bottom']['views_slideshow_controls']['type'] = 'views_slideshow_controls_text';
$handler->display->display_options['style_options']['widgets']['bottom']['views_slideshow_slide_counter']['weight'] = '1';
$handler->display->display_options['style_options']['views_slideshow_cycle']['effect'] = 'cover';
$handler->display->display_options['style_options']['views_slideshow_cycle']['timeout'] = '5000';
$handler->display->display_options['style_options']['views_slideshow_cycle']['speed'] = '700';
$handler->display->display_options['style_options']['views_slideshow_cycle']['delay'] = '0';
$handler->display->display_options['style_options']['views_slideshow_cycle']['start_paused'] = 0;
$handler->display->display_options['style_options']['views_slideshow_cycle']['remember_slide_days'] = '1';
$handler->display->display_options['style_options']['views_slideshow_cycle']['items_per_slide'] = '1';
$handler->display->display_options['style_options']['views_slideshow_cycle']['cleartype'] = 0;
$handler->display->display_options['style_options']['views_slideshow_cycle']['cleartypenobg'] = 0;
$handler->display->display_options['defaults']['style_options'] = FALSE;
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
$handler->display->display_options['row_plugin'] = 'fields';
$handler->display->display_options['defaults']['row_options'] = FALSE;
$handler->display->display_options['defaults']['fields'] = FALSE;
/
Field: Content: Link /
$handler->display->display_options['fields']['field_link']['id'] = 'field_link';
$handler->display->display_options['fields']['field_link']['table'] = 'field_data_field_link';
$handler->display->display_options['fields']['field_link']['field'] = 'field_link';
$handler->display->display_options['fields']['field_link']['label'] = '';
$handler->display->display_options['fields']['field_link']['exclude'] = TRUE;
$handler->display->display_options['fields']['field_link']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_link']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_link']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['field_link']['alter']['external'] = 0;
$handler->display->display_options['fields']['field_link']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['field_link']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_link']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['field_link']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_link']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_link']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_link']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_link']['element_label_colon'] = 0;
$handler->display->display_options['fields']['field_link']['element_default_classes'] = 1;
$handler->display->display_options['fields']['field_link']['hide_empty'] = 0;
$handler->display->display_options['fields']['field_link']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_link']['click_sort_column'] = 'url';
$handler->display->display_options['fields']['field_link']['type'] = 'plain';
$handler->display->display_options['fields']['field_link']['field_api_classes'] = 0;
/
Field: Content: Image */
$handler->display->display_options['fields']['field_image']['id'] = 'field_image';
$handler->display->display_options['fields']['field_image']['table'] = 'field_data_field_image';
$handler->display->display_options['fields']['field_image']['field'] = 'field_image';
$handler->display->display_options['fields']['field_image']['label'] = '';
$handler->display->display_options['fields']['field_image']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['make_link'] = 1;
$handler->display->display_options['fields']['field_image']['alter']['path'] = '[field_link]';
$handler->display->display_options['fields']['field_image']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['external'] = 1;
$handler->display->display_options['fields']['field_image']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_image']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_image']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_image']['element_label_colon'] = 0;
$handler->display->display_options['fields']['field_image']['element_default_classes'] = 1;
$handler->display->display_options['fields']['field_image']['hide_empty'] = 0;
$handler->display->display_options['fields']['field_image']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_image']['click_sort_column'] = 'fid';
$handler->display->display_options['fields']['field_image']['settings'] = array(
  'image_style' => 'medium',
  'image_link' => '',
);
$handler->display->display_options['fields']['field_image']['field_api_classes'] = 0;
$translatables['slideshow_test'] = array(
  t('Master'),
  t('slideshow_test'),
  t('more'),
  t('Apply'),
  t('Reset'),
  t('Sort by'),
  t('Asc'),
  t('Desc'),
  t('Items per page'),
  t('- All -'),
  t('Offset'),
  t('Image'),
  t('Title'),
  t('Block'),
  t('[field_link]'),
);

Immense gratitude!

Screenack's picture

Well the good news is we've narrowed it down. It looks like it's something specific to my environment, while not addressing the bug, it is helpful in tracking the problem down.

I was unable to import your view, apparently D7/Views can not create the corresponding field types to make the view parse correctly.

I also disable all non-dependent modules, but that didn't help any.

I think I'll try again from scratch.

With deep gratitude,
Kyle

triDUG

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: