Permalink
Browse files

Fixed Matrix JS error; no longer trying to run during Channel Entries…

… API calls
  • Loading branch information...
1 parent 6a19723 commit c47ae4e2414fa02e242330842c1a18f217b1952d @amphibian committed Feb 4, 2013
@@ -23,7 +23,7 @@ class Eevent_helper_ext
{
var $settings = array();
var $name = 'Event Helper';
- var $version = '2.1.4';
+ var $version = '2.1.5';
var $description = 'Automatically sets the expiration date for event entries, and more.';
var $settings_exist = 'y';
var $docs_url = 'http://github.com/amphibian/eevent_helper.ee2_addon';
@@ -195,8 +195,9 @@ function _process_dates($channel_id, $hook, $custom_fields = '')
{
$key = $this->_is_event_channel($channel_id);
-
- if($key !== FALSE)
+
+ // REQ == 'CP' is checked because we can't work with programatically-loaded Channel Entries API calls
+ if($key !== FALSE && ($hook == 'safecracker_submit_entry_start' || REQ == 'CP') )
{
$this->settings = $this->get_settings();
@@ -23,7 +23,7 @@ class Eevent_helper_ft extends EE_Fieldtype {
var $info = array(
'name' => 'Event Helper Date',
- 'version' => '2.1.4'
+ 'version' => '2.1.5'
);
var $has_array_data = FALSE;
@@ -121,7 +121,7 @@ function initEventHelperFields(context) {
if($matrix)
{
- $js = '
+ $js .= '
Matrix.bind("eevent_helper", "display", function(cell) {
initEventHelperFields(cell.dom.$td);
});';

0 comments on commit c47ae4e

Please sign in to comment.