While poking around with #628032: Incorrect variable name in ad_views.views-ad_html.inc I realized I had another problem, once I got the 'html' field to display -- I couldn't get rid of the markup. Line 30 in ad_views.views-ad_html.inc indicates the html field is called with the 'views_handler_field' handler.

I checked the Views API docs at http://views.doc.logrus.com/classviews__handler__field.html -- if I'm reading it correctly, 'views_handler_field' renders an unformatted field only. Since the body of the ad is almost certainly going to contain HTML, since it's a HTML ad, it seems like this is the wrong way to go -- shouldn't it be using 'views_handler_field_markup' and checking the value of 'format' in the node_revisions table instead?

Comments

milesgillham’s picture

Status: Active » Needs review

From what I can see this might be the right way to fix. Using the markup handler and indicating the format field. But I'm being monkey-see, monkey-do there, I need to understand moc's code better. Have updated in -dev, pending further examination.

    // Ad HTML - 'html'
    $data['ad_html']['html'] = array(
      'title' => t('HTML'),
      // The help that appears on the UI
      'help' => t('The ad HTML.'),
      // Information for displaying
      'field' => array(
        'handler' => 'views_handler_field_markup',
        'format' => 'format', // The name of the format field
        'click sortable' => FALSE
      )
    );

milesgillham’s picture

If no further comments on this I'll fold this into the beta2 release and close the issue.

milesgillham’s picture

Status: Needs review » Active

Actually, I now understand what @domesticat means and you are entirely right. The only problem is getting the format column from out of the node_revisions table. I'm thinking some additional handler code will be required to do the lookup as I don't think the default markup handler can do it. Further investigation.

milesgillham’s picture

Status: Active » Closed (fixed)

So I've realised that the format field is irrelevant, the rendering is done using the ad module renderer. Setting the format to '0' and closing the ticket.