diff --git a/nightly/changelog b/nightly/changelog index b898f91..ec4b619 100644 --- a/nightly/changelog +++ b/nightly/changelog @@ -1,3 +1,14 @@ +#v1.8.7 +====== +23.08.2024 + +* Fix in create_structure.php: Allow SELECT on recent fields defaultvalue and extras +* Fix in sidebar_functions.php: empty conditions now work for 'in ()' constructs +* Fix in changeConfig: 0 == '' resolved by checking with '===' +* Fix in table hierarchy update (costs one query more per 'anwenden') +* Complement returns symbols (with ids) in case no filter is selected for the complement + table + #v1.8.6 ====== 10.05.2024 diff --git a/nightly/changelog_user b/nightly/changelog_user index 4def642..5d5daee 100644 --- a/nightly/changelog_user +++ b/nightly/changelog_user @@ -1,3 +1,9 @@ +#v1.8.7 +====== + +* Komplemente zeigen Ergebnisse, auch wenn keine Filter ausgewählt sind +* einige Bugfixes + #v1.8.6 ====== diff --git a/nightly/core/data/info.php b/nightly/core/data/info.php index d30269c..d0fc7ef 100644 --- a/nightly/core/data/info.php +++ b/nightly/core/data/info.php @@ -1,7 +1,7 @@ diff --git a/nightly/core/functions/config_functions.php b/nightly/core/functions/config_functions.php index fef6ef5..cd85cd7 100644 --- a/nightly/core/functions/config_functions.php +++ b/nightly/core/functions/config_functions.php @@ -149,11 +149,11 @@ function changeConfig(array $newconf, mysqli $conn, string $configname = 'Defaul if ( is_array($value) ) { foreach ( $value as $key2=>$value2 ) { - if ( ! isset($value2) OR $value2 == '' ) { unset($conf[$key][$key2]); }; + if ( ! isset($value2) OR $value2 === '' ) { unset($conf[$key][$key2]); }; if ( is_array($value2) ) { foreach ( $value2 as $key3=>$value3 ) { - if ( ! isset($value3) OR $value3 == '' ) { unset($conf[$key][$key2][$key3]); }; + if ( ! isset($value3) OR $value3 === '' ) { unset($conf[$key][$key2][$key3]); }; if ( is_array($value3) ) { foreach ( $value3 as $key4=>$value4 ) { diff --git a/nightly/core/functions/frontend_functions.php b/nightly/core/functions/frontend_functions.php index fb32541..474082c 100644 --- a/nightly/core/functions/frontend_functions.php +++ b/nightly/core/functions/frontend_functions.php @@ -2,6 +2,6 @@ function html_echo($string = '') { if ( isset($string) ) { echo(htmlentities($string)); }; } //use ENT_QUOTES | ENT_IGNORE ? function link_echo($string = '') { - echo(preg_replace('/Video:([^#]*)#/','Video
',$string));    
+    echo(preg_replace('/Video:([^#]*)#/','
Video
',$string));    
 }
 ?>
diff --git a/nightly/core/functions/sidebar_functions.php b/nightly/core/functions/sidebar_functions.php
index 9248d24..a2af8ca 100644
--- a/nightly/core/functions/sidebar_functions.php
+++ b/nightly/core/functions/sidebar_functions.php
@@ -137,6 +137,11 @@ class="subtableOf"
 			}
 		}
 	}
+    
+    //save computed hierarchy, otherwise the computed hierarchy and the one used in applyFilters differ (is read freshly from config)
+    ///(...with unpredictable results...)
+    ksort($_config_hierarchy);
+    changeConfig(array("table_hierarchy" => array_values($_config_hierarchy)),$conn);
 	?>
 	
@@ -936,6 +941,7 @@ function applyFilters(array $parameter, mysqli $conn, bool $_complement = false, $_SESSION['filterlog'] = json_encode($filterlog); // $_WHERE .= $bracket; + $_WHERE = preg_replace('/IN \(\)/i',"NOT IN (-1)",$_WHERE); $_WHERE = preg_replace('/\(\)/',"(0=0)",$_WHERE); $_main_stmt_array = array(); $_main_stmt_array['stmt'] = 'SELECT '.$_SELECT.$_FROM.$_WHERE.$_ORDER_BY; //do not order by id! @@ -972,6 +978,8 @@ function applyFilters(array $parameter, mysqli $conn, bool $_complement = false, } //remove trailing komma of $_SELECT if no paramater of complementtable was selected if ( substr($_SELECT,-1) == ',' ) { $_SELECT = substr($_SELECT, 0, -1); } + //order by id if no filter was selected for complment table + if ( $_ORDER_BY == ' ORDER BY ' ) { $_ORDER_BY .= $complementtable.'__id_'.$complementtable; } $_main_stmt_array['stmt'] = $_SELECT.$_FROM.$_WHERE.$_main_stmt_array['stmt'].$bracket.$_ORDER_BY; } if ( isset($display) AND !$display ) { return $_main_stmt_array; } diff --git a/nightly/core/html/create_structure.php b/nightly/core/html/create_structure.php index 045146b..2ee0296 100644 --- a/nightly/core/html/create_structure.php +++ b/nightly/core/html/create_structure.php @@ -970,7 +970,7 @@ function _adminActionAfter(array $PARAMETER, mysqli $conn) { $_stmt_array['stmt'] = "ALTER TABLE `".$_table."_permissions` ADD COLUMN `restrictrole_".$_result_id."` VARCHAR(40) DEFAULT NULL;"; _execute_stmt($_stmt_array,$conn); unset($_stmt_array); $_stmt_array = array(); - $_stmt_array['stmt'] = "GRANT SELECT (keymachine,keyreadable,subtablemachine,typelist,edittype,realid,referencetag,role_".$_result_id.",restrictrole_".$_result_id.") ON ".$_table."_permissions TO ".$_ROLES_ARRAY[$_result_id].";"; + $_stmt_array['stmt'] = "GRANT SELECT (keymachine,keyreadable,subtablemachine,defaultvalue,extras,typelist,edittype,realid,referencetag,role_".$_result_id.",restrictrole_".$_result_id.") ON ".$_table."_permissions TO ".$_ROLES_ARRAY[$_result_id].";"; _execute_stmt($_stmt_array,$conn); unset($_stmt_array); $_stmt_array = array(); $_stmt_array['stmt'] = "GRANT SELECT (role_".$_result_parentid.",restrictrole_".$_result_parentid.") ON ".$_table."_permissions TO ".$_ROLES_ARRAY[$_result_id].";"; diff --git a/nightly/public/js/os.js b/nightly/public/js/os.js index cc97faa..6e5d968 100644 --- a/nightly/public/js/os.js +++ b/nightly/public/js/os.js @@ -1439,7 +1439,7 @@ function showEmptyFields(_form,_arg,resp) { if ( ! _filled ) { editwrapper.style.background = "var(--background-warning)"; console.log(editwrapper.querySelectorAll('label')); - _notFilledFields.push({_id: _inputid, _label: editwrapper.querySelector('label.onlyone,label.files').innerText}); + _notFilledFields.push({_id: _inputid, _label: editwrapper.querySelector('label.onlyone,label.files')?editwrapper.querySelector('label.onlyone,label.files').innerText:''}); } }); //create the message