CMS MADE SIMPLE FORGE

CGCalendar

 

[#3336] Custom fields not included in recurrances

avatar
Created By: Matt Haworth (acrim)
Date Submitted: Mon Apr 20 11:16:06 -0400 2009

Assigned To: Robert Campbell (calguy1000)
Version: 1.1
CMSMS Version: None
Severity: Minor
Resolution: Accepted
State: Open
Summary:
Custom fields not included in recurrances
Detailed Description:
Custom fields are only included in the first instance of an event, and are not
reflected in subsequent instances of that event.

For example if I create an image field, then create an even with that image
field that recurs every monday, only the first event created will include the
image on the output, all other events after that will be missing the image.

Using cgcalendar 1.1 and CMSMS 1.5.1


History

Comments
avatar
Date: 2010-03-08 19:22
Posted By: Steven (CalMah)

I have the same problem with CGCalendar 1.3 and CMSMS 1.6.7.
I'm currently using {$event.fields.CustomFieldName} to fetch the data.
      
avatar
Date: 2013-02-18 08:48
Posted By: stephen cooper (scooper)

Was having the same problem in current versions (CMS 1.11.4 / CGCalender
1.10.2).

I fixed it by putting in a check for event_parent_id when looking up the custom
field values and using the custom fields for the parent in recurring child
events.

In function.displayevent.php at line 139 I replaced:

		// Build the sql to retrieve the field values for this event.
		$sql = "SELECT field_name,field_value
			FROM $event_field_values_table_name
			WHERE event_id = $event_id";z
		$frs = $db->Execute($sql); // Get the field values


with:

		// Build the sql to retrieve the field values for this event.
		$sql = "SELECT field_name,field_value
			FROM $event_field_values_table_name
			WHERE event_id = ?";
			
		//use parent id if this is a child event
		if($event['event_parent_id']>0){
$frs = $db->Execute($sql,array($event['event_parent_id'])); // Get the field
values
		}else{
		      	$frs = $db->Execute($sql,array($event_id)); // Get the field values
		}

which has done the trick for me.

Similar code appears in function.displaylist.php at about line 242 to pull out
custom fields in list view.

Hope that helps. Thanks as always etc etc.

s.




      
Updates

Updated: 2012-06-24 23:50
resolution_id: => 6
severity_id: 1 => 3
cmsms_version_id: => -1