diff --git a/system/third_party/nf_categories_field/config.php b/system/third_party/nf_categories_field/config.php index 4e79367..44429e9 100644 --- a/system/third_party/nf_categories_field/config.php +++ b/system/third_party/nf_categories_field/config.php @@ -12,7 +12,7 @@ if ( ! defined('NF_CF_NAME')) { define('NF_CF_NAME', 'Categories Field'); - define('NF_CF_VERSION', '1.0.7'); + define('NF_CF_VERSION', '1.0.8'); define('NF_CF_DOCS', 'http://github.com/ninefour/categories_field.ft.ee_addon'); } diff --git a/system/third_party/nf_categories_field/ft.nf_categories_field.php b/system/third_party/nf_categories_field/ft.nf_categories_field.php index f1f332a..c150039 100644 --- a/system/third_party/nf_categories_field/ft.nf_categories_field.php +++ b/system/third_party/nf_categories_field/ft.nf_categories_field.php @@ -579,7 +579,7 @@ function replace_primary_category_id($data, $params = array(), $tagdata = FALSE) // array_filter removes empty nodes, array_values re-indexes $categories = array_values(array_filter(explode($settings['delimiter'], $data))); - if (substr( $categories[0], 0, 1 ) === "p") { + if ($categories AND substr( $categories[0], 0, 1 ) === "p") { $primary_cat_id = ltrim($categories[0],'p'); }