“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison
Not sure what the confusion/issue is, but let me discuss a little about change control...
Looking back on the history of admin/easypopulate_import.php, one can see that $categories_delimiter was set as:
Somewhere around line 1097 (at one point, ie: https://github.com/mc12345678/EasyPopulate-4.0/blob/37d4428346615d82127117df00b9ceb1e8b69db4/admin/easypopulate_4_import.php)Code:$categories_delimiter = "^";
So, looking through the code, the only place that the variable $categories_delimiter was used, was in the commented out explode function that followed it for those that might still be using latin1.
Okay, so the variable basically wasn't used anywhere in the import code.
Now, the overall goal is that whatever is used to join the categories on export, would be the same as that for separating them on import. Well, on export the variable used was simply a carat "^", no special UTF-8, no mb_implode (assuming function exists), nothing special... Just take the category's root, append the carat, add the next sub-category, add a carat, and in the end have the category path for the product concatenated with the carat between each category.
So... Then on import, the goal was to then take all of those carat's and split them up to go to the appropriate category tree... Well, in an effort to maintain the ability to do that with "foreign" characters, the multi-byte function mb_split was used which is supposed to analyze the string and correctly identify where the cut-offs are at. Well, at the time of writing, it was not discovered on how to split that string into it's pieces using the multi-byte function and the desired character; however, it was known what that character in UTF-8 had to be: \x5e. So to allow things to move forward, the specific UTF-8 equivalent character encoding was supplied to the mb_split function and the variable $categories_delimiter was in a way "left behind"... But.....
Now there are those that have (maybe?) reviewed the code because of some issue and seen the comment in the file... Hey if you're using latin1, then uncomment the one line and comment out the mb_split line... Okay, so they do that and continue on their merry way knowing that $categories_delimiter is set as "^" and is used in the function. So, sure the individuals could have gone and changed other things, but now a modification has been introduced. Namely, if we define the delimiter to be used for any category at the "top" of execution, ie in one place, then it needs to be used in all places..... Well, to accomplish this and not modify too many places of code for too many different users, make the least amount of changes at this time to maintain operation for those that have chosen to use the code as is. Therefore, for those still using latin1 (for the most part suggest moving to UTF-8 as ZC now pushes for all things to be UTF-8), then the $categories_delimiter variable should match whatever is being used on export ($categories_delimiter = $category_delimiter).... Okay, so that would take care of those using latin1; however, those using UTF-8 (otherwise unaltered code), they need to have something consistent... Well, in the import side there is this variable that now is assigned to a relatively appropriate value and is defined locally rather than some far off distant pre-code, so... $categories_delimiter was chosen to be used... This also would support those that may have previously used that variable similar to how it is being used now (preg_quote($categories_delimiter)) therefore, this would have a minimal impact on those users that chose not to share their solution. Will it stay this way? Maybe, maybe not, but it provided some of the minimal changes that could be made to remain possible to follow and logical when reviewing the code. Could the mb_split function have used $category_delimiter, sure, but would you know where to search at that point to identify what it's value was? The other way this could have gone is that everywhere on the export code that $category_delimiter was used it could have been renamed $categories_delimiter, and then the $categories_delimiter in the import code could have been commented out... Considered that.. Didn't make sense...
Plus for those that did any type of comparison in upgrading and saw this change and saw that it didn't work could revert back to what was previously there with great ease... The two of you identified there was a problem, provided alternate solutions; however, neither appeared to accomplish the main goal, divide a string of text that is in UTF-8 format into its UTF-8 components based on a UTF-8 "divider" regardless of the language or information in the string and to ensure that the dividing delimiter was the same for both export AND import through a single assignment... Ie.. Make it easier for those that use this to maintain consistency and to alter the divider as desired...
So, like I said, I don't know what the issue is with the variable $categories_delimiter at least "temporarily" (until a later change) being used and assigned to $category_delimiter is...
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
No issue or confusion, I was just pointing that out.
“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
That in EP4
on import (before the your last commit ):PHP Code:$category_delimiter = "\x5e"; //Need to move this to the admin panel
Why not :PHP Code:$categories_delimiter = $category_delimiter;
$categories_names_array[$lang['id']] = mb_split($categories_delimiter, $items[$filelayout['v_categories_name_' . $lang['id']]]);
[/PHP]PHP Code:$categories_names_array[$lang['id']] = mb_split($category_delimiter , $items[$filelayout['v_categories_name_' . $lang['id']]]);
But has you explain, this was a ongoing process, and I quite understood.
“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison
Submitted version 4.0.34.a to include the preg_quote() command for import and address maintaining the category separation for both export and import... That is the only real change, which for those that already have installed 4.0.34 or manually made some of the earlier changes will see the notification on their admin page.
When reviewed and accepted will be available from this download link.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...