Skip to content

Commit

Permalink
Fixed bug with parent in Relax mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad Ghita committed Nov 8, 2012
1 parent 55a139f commit de42321
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/class.PLHManagerURL.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,11 @@ private static function _processRelax($old_url, $ref_handle, $target_handle){
foreach( $old_url as $value ){
if( !empty($value) ){
$query = sprintf(
"SELECT `id`, `%s`, `parent` FROM `tbl_pages` WHERE `%s` = '%s' LIMIT 1",
$target_handle, $ref_handle, $value
"SELECT `id`, `%s`, `parent` FROM `tbl_pages` WHERE `%s` = '%s' AND `parent` %s LIMIT 1",
$target_handle,
$ref_handle,
$value,
$last_parent != null ? sprintf("= %s", $last_parent) : "IS NULL"
);

$bit = self::_getPageHandle($query, $last_parent, $target_handle);
Expand Down

0 comments on commit de42321

Please sign in to comment.