Modify

Opened 7 years ago

Closed 7 years ago

#1495 closed Bug/Fehler (fixed)

xtc_check_categories_status

Reported by: Volker Strähle Owned by: somebody
Priority: normal Milestone: modified-shop-2.0.5.0
Component: Shop Version: 2.0.4.0
Keywords: Cc:
Blocked By: Blocking:

Description

Warum wird für eine Kategorie mit Status 0 als Ergebnis 1 (true) zurückgegeben?

function xtc_check_categories_status($categories_id) {

	if (!$categories_id) {
		return 0;
  }

	$categorie_query = xtDBquery("SELECT parent_id,
                                       categories_status
                                  FROM ".TABLE_CATEGORIES."
                                 WHERE categories_id = '".(int)$categories_id."'
                                       ".CATEGORIES_CONDITIONS);
	
	$categorie_data = xtc_db_fetch_array($categorie_query, true);
	if ($categorie_data['categories_status'] == 0) {
		return 1;  // <<<<< RICHTIG ???
	} else {
		if ($categorie_data['parent_id'] != 0) {
			if (xtc_check_categories_status($categorie_data['parent_id']) >= 1) {
				return 1;
			}
		}
		return 0;
	}
}

Wäre nicht

function xtc_check_categories_status($categories_id) {

	if (!$categories_id) {
		return 0;
  }

	$categorie_query = xtDBquery("SELECT parent_id,
                                       categories_status
                                  FROM ".TABLE_CATEGORIES."
                                 WHERE categories_id = '".(int)$categories_id."'
                                       ".CATEGORIES_CONDITIONS);
	
	$categorie_data = xtc_db_fetch_array($categorie_query, true);
  if (($categorie_data['categories_status'] >= 1) && ($categorie_data['parent_id'] == 0)) {
		return 1;
	} else {
    if (($categorie_data['categories_status'] >= 1) && ($categorie_data['parent_id'] != 0)) {
			if (xtc_check_categories_status($categorie_data['parent_id']) >= 1) {
				return 1;
			}
		}
		return 0;
	}
}

richtiger?

Attachments (0)

Change History (1)

comment:1 by Gerhard Waldemair, 7 years ago

Resolution: fixed
Status: newclosed

In 11703:

fix #1495

Modify Ticket

Action
as closed The owner will remain somebody.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.