CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Another question re: Views 2 integration
Pages: [1] 2

Author Topic: Another question re: Views 2 integration  (Read 8482 times)

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Another question re: Views 2 integration
November 25, 2008, 04:32:05 pm
This may be a really dumb question, but I'm new to using Views 2 (it's certainly impressive, and I'll be using it more widely in future), and fairly new to CiviCRM, so here goes.

I've created a Views page to display CiviCRM event information.

Two issue arise:

1. If I try to filter the view so only events are shown where the event end date is greater than or equal to -30 days, I get an error. Not sure why. Anyone got any thoughts on this?

2. I have entered event description content into CiviEvent using HTML via the FCKEditor. On CiviEvent pages this content renders fine, but on the Views page it looks like all the HTML tags have been escaped. This is probably really obvious, but I can't spot where I'm going wrong here.

Any input most welcome.

Regards
Graham



Graham Mitchell
http://mc3.coop

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Another question re: Views 2 integration
November 25, 2008, 09:17:00 pm

The event integration code was contributed by a community member. You might have to get into the code and help debug and fix the issue. I've asked the person to check this topic and see if he can help out

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

nottwo

  • Guest
Re: Another question re: Views 2 integration
November 26, 2008, 09:38:29 am
Quote from: Upperholme on November 25, 2008, 04:32:05 pm
1. If I try to filter the view so only events are shown where the event end date is greater than or equal to -30 days, I get an error. Not sure why. Anyone got any thoughts on this?

This is a bug that slipped in at the last minute that's easy to fix.

Edit the file drupal/modules/views/civicrm/civicrm_handler_filter_datetime.inc and go to line 19.

Change
Code: [Select]
$value = civicrm_format_date($value);
to:
Code: [Select]
$value = $this->format_date($value);
This makes me want to implement tests even more now! 


Quote
2. I have entered event description content into CiviEvent using HTML via the FCKEditor. On CiviEvent pages this content renders fine, but on the Views page it looks like all the HTML tags have been escaped. This is probably really obvious, but I can't spot where I'm going wrong here.

I can confirm that the view is stripping the HTML.  I'll submit a patch that updates the code to pass markup through and possibly allow setting an input filter.  Hopefully it can get in before the code freeze for 2.2.



Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Another question re: Views 2 integration
November 26, 2008, 10:34:25 am

the first part is fixed and will be part of 2.1.3 (and 2.2)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Re: Another question re: Views 2 integration
November 26, 2008, 01:45:16 pm
Excellent - many thanks for the responses. I'll  fix the minor bug as advised, and eagerly await the revision that will resolve the HTML issue.

Thanks again
Graham
Graham Mitchell
http://mc3.coop

nottwo

  • Guest
Re: Another question re: Views 2 integration
December 01, 2008, 01:50:50 pm
Quote from: Upperholme on November 26, 2008, 01:45:16 pm
Excellent - many thanks for the responses. I'll  fix the minor bug as advised, and eagerly await the revision that will resolve the HTML issue.

I've put a patch up on the issue tracker: http://issues.civicrm.org/jira/browse/CRM-3886
If you feel comfortable applying patches, that will get you most of the way there.  Otherwise, hopefully this can still make it in for 2.1.3 or 2.2

I'm not sure what the best way to select the input filters.  Most times in Drupal, a filter will be specified on a node, and Views2 will use that to display fields.  CiviCRM Events don't have Drupal input filters associated with their fields, so there isn't a default there.   Right now the patch just uses the input filter that's defined as the default in the Drupal admin pages.

Where do you think it would make sense to allow the admin to set or override the input filter on event views?  Each field could have its own settable filter, or maybe just one input filter per view?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Another question re: Views 2 integration
December 01, 2008, 04:21:52 pm

patched the 2.1 branch and will be part of 2.1.3

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Re: Another question re: Views 2 integration
December 02, 2008, 07:05:45 am
For my money one input filter per view would do the trick. Doing it per field would probably be overkill in most cases.

Regards
Graham
Graham Mitchell
http://mc3.coop

jamie

  • I post occasionally
  • **
  • Posts: 95
  • Karma: 6
Re: Another question re: Views 2 integration
September 14, 2009, 08:48:26 am
I'm still experiencing the problem with html tags being escaped (displayed literally) in views2 for the event description field.

Browsing the patch (http://issues.civicrm.org/jira/secure/attachment/11385/civicrm_handler_field_event.patch) it looks like the code has been significantly re-written since the patch was submitted.

Are others experiences this problem? Or - perhaps there is something uniquely not configured properly on my site?!

Thanks in advance for any help!

jamie

jamie

  • I post occasionally
  • **
  • Posts: 95
  • Karma: 6
Re: Another question re: Views 2 integration
September 14, 2009, 09:36:32 am
I'm not sure if this is handled more elegantly else where ... however, I've attaching a patch to civicrm.views.inc and a new file civicrm_handler_field_html.inc that enables the use of html in event descriptions and summaries. I'm posting here since the original issue is closed so I don't think I can patch a file to it.

jamie

jalama

  • I post frequently
  • ***
  • Posts: 176
  • Karma: 22
    • Rooty Hollow LLC
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6 and 7
  • MySQL version: 5.1
  • PHP version: 5.2.5 and 5.3
Re: Another question re: Views 2 integration
September 14, 2009, 08:22:43 pm
the only issue here is the check_markup function defaults to Drupal's default input format (aka text format in D7).  This is only an issue if you are adding mark-up to your event description that is filtered by the default input format.  Though I have to admit I don't really know a better solution that we can get into 3.0 unless you allow users to choose the format in the field settings of the view.

So I guess this will suffice for the time being, but we should note the need to a better solution.
http://www.rootyhollow.com

jamie

  • I post occasionally
  • **
  • Posts: 95
  • Karma: 6
Re: Another question re: Views 2 integration
September 15, 2009, 06:39:24 am
When using check_markup  - my understanding is the it will default to the site's default filter format rather than a hard-coded Drupal filter format, meaning the user has at least some control over it. However, it still a bad idea to force someone to change their entire site's default filter format just to get event description to show up with certain html code!

Adding a drop down for input filter based on available Drupal input filters sounds to me like a better way to handle it.

jamie

jamie

  • I post occasionally
  • **
  • Posts: 95
  • Karma: 6
Re: Another question re: Views 2 integration
December 15, 2009, 06:29:00 pm
Still seems to be a problem with civicrm 3.

I'm attaching patches for civicrm 3 that will use a new markup field handler by default for all strings. This (again) is probably over kill but not sure how to do this more elegantly.

jamie

jamie

  • I post occasionally
  • **
  • Posts: 95
  • Karma: 6
Re: Another question re: Views 2 integration
December 29, 2009, 11:09:08 am
I'm re-attaching improved versions of these files.

Now, the standard event description and summary fields use the new markup handler.

And - I've removed some cruft from the markup handler file.

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Another question re: Views 2 integration
July 01, 2010, 09:26:40 am
I just applied these patches on 3.1.5...can these get put in Core for the 3.2 stable?

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Another question re: Views 2 integration

This forum was archived on 2017-11-26.