mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-26 07:49:28 +01:00
Make category name->id translator able to handle any IDs that are passed
This commit is contained in:
parent
5344d0a0ae
commit
a47732d530
@ -148,6 +148,11 @@ class importexport_helper_functions {
|
|||||||
$cat_names = is_array( $_cat_names ) ? $_cat_names : explode( ',', $_cat_names );
|
$cat_names = is_array( $_cat_names ) ? $_cat_names : explode( ',', $_cat_names );
|
||||||
foreach ( $cat_names as $cat_name ) {
|
foreach ( $cat_names as $cat_name ) {
|
||||||
if ( $cat_name == '' ) continue;
|
if ( $cat_name == '' ) continue;
|
||||||
|
// Handle any IDs that slip in
|
||||||
|
if ( is_numeric($cat_name) && categories::id2name((int)$cat_name)) {
|
||||||
|
$cat_ids[] = (int)$cat_name;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if ( ( $cat_id = $cats->name2id( $cat_name ) ) == 0 ) {
|
if ( ( $cat_id = $cats->name2id( $cat_name ) ) == 0 ) {
|
||||||
$cat_id = $cats->add( array(
|
$cat_id = $cats->add( array(
|
||||||
'name' => $cat_name,
|
'name' => $cat_name,
|
||||||
|
Loading…
Reference in New Issue
Block a user