Skip to content

Commit

Permalink
Assign a default value for categories_description
Browse files Browse the repository at this point in the history
When generating a new category using EP4 while adding a new product, the category name is inserted; however, there has not been a description entered yet and therefore there was no data available to import.  A default ZC install does not assign a default value for the categories_description field within the categories_description table.  

This adds a default value; however, the database should be first queried to identify the existence of a default value.  If a default value is there, then either use the default value or don't include the categories_description when inserting that record.
This relates to #47.
  • Loading branch information
mc12345678 authored May 16, 2018
1 parent c24df33 commit 57dda2b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion admin/easypopulate_4_import.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

$lid_first = $epdlanguage_id;
$lid_first_code = $epdlanguage_code;

$cat_desc_default = ''; // Should evaluate the database to determine if one is already set and leave it alone if it is.

$zco_notifier->notify('EP4_IMPORT_START');

Expand Down Expand Up @@ -939,7 +941,8 @@
$sql = "INSERT INTO " . TABLE_CATEGORIES_DESCRIPTION . " SET
categories_id = :categories_id:,
language_id = :language_id:,
categories_name = :categories_name:";
categories_name = :categories_name:
categories_description = :categories_description:";
$sql = $db->bindVars($sql, ':categories_id:', $max_category_id, 'integer');
$sql = $db->bindVars($sql, ':language_id:', $cat_lang_id, 'integer');

Expand Down Expand Up @@ -983,6 +986,7 @@
unset($oldPost);
}
$sql = $db->bindVars($sql, ':categories_name:', ep_4_curly_quotes($thiscategoryname), $zc_support_ignore_null);
$sql = $db->bindVars($sql, ':categories_description:', $cat_desc_default, $zc_support_ignore_null);
}
unset($v_categories_name_check);
unset($cat_lang_id);
Expand Down

0 comments on commit 57dda2b

Please sign in to comment.