Skip to content

Commit e7524d0

Browse files
authored
Merge pull request #2814 from jeedom/beta
Stable 4.4.10
2 parents 457ac0c + 6526fad commit e7524d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1702
-790
lines changed

.github/workflows/docker-image-latest.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
# only trigger CI when push on following branches
66
branches:
7-
- 'V4-stable'
7+
- 'master'
88
- 'beta'
99
# this is to manually trigger the worklow
1010
workflow_dispatch:

.github/workflows/work.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
branches:
99
- alpha
1010
- beta
11-
- V4-stable
11+
- master
1212

1313
name : 'Test Core Jeedom'
1414

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ARG DEBIAN
55
# ARG to build Docker images ... ENV to run Docker container
66
ARG WEBSERVER_HOME=/var/www/html
77
ENV WEBSERVER_HOME=${WEBSERVER_HOME}
8-
ARG VERSION=V4-stable
8+
ARG VERSION=master
99
ENV VERSION=${VERSION}
1010
ARG DATABASE=1
1111
ENV DATABASE=${DATABASE}

core/ajax/cache.ajax.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@
3737
ajax::success(utils::o2a(cache::byKey(init('key'))));
3838
}
3939

40+
if (init('action') == 'remove') {
41+
unautorizedInDemo();
42+
ajax::success(cache::delete(init('key')));
43+
}
44+
4045
if (init('action') == 'flush') {
4146
unautorizedInDemo();
4247
cache::flush();
@@ -49,10 +54,6 @@
4954
ajax::success();
5055
}
5156

52-
if (init('action') == 'stats') {
53-
ajax::success(cache::stats());
54-
}
55-
5657
throw new Exception(__('Aucune méthode correspondante à :', __FILE__) . ' ' . init('action'));
5758
/* * *********Catch exeption*************** */
5859
} catch (Exception $e) {

core/ajax/object.ajax.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
ajax::success($return);
138138
}
139139

140-
function jeeAjax_objectToHtml($_id = -1, $_version = 'dashboard', $_category = 'all', $_tag = 'all', $_summary = '') {
140+
function jeeAjax_objectToHtml($_id = -1, $_version = 'dashboard', $_category = 'all', $_tag = 'all', $_summary = '',$_hideOnMain = 0) {
141141
$html = array();
142142
if ($_summary == '') {
143143
$eqLogics = eqLogic::byObjectId($_id, true, true);
@@ -153,6 +153,9 @@ function jeeAjax_objectToHtml($_id = -1, $_version = 'dashboard', $_category = '
153153
if ($_tag != 'all' && strpos($eqLogic->getTags(), init('tag')) === false) {
154154
continue;
155155
}
156+
if ($_hideOnMain == 1 && $eqLogic->getConfiguration('hideOnMain',0) == 1) {
157+
continue;
158+
}
156159
$order = $eqLogic->getOrder();
157160
while (isset($html[$order])) {
158161
$order++;
@@ -197,13 +200,13 @@ function jeeAjax_objectToHtml($_id = -1, $_version = 'dashboard', $_category = '
197200
$return = array();
198201
$i = 0;
199202
foreach ($objects as $id) {
200-
$html = jeeAjax_objectToHtml($id, init('version'), init('category', 'all'), init('tag', 'all'), init('summary'));
203+
$html = jeeAjax_objectToHtml($id, init('version'), init('category', 'all'), init('tag', 'all'), init('summary'),init('hideOnMain',0));
201204
$return[$i . '::' . $id] = $html;
202205
$i++;
203206
}
204207
ajax::success($return);
205208
} else {
206-
$html = jeeAjax_objectToHtml(init('id'), init('version'), init('category', 'all'), init('tag', 'all'), init('summary'));
209+
$html = jeeAjax_objectToHtml(init('id'), init('version'), init('category', 'all'), init('tag', 'all'), init('summary'),init('hideOnMain',0));
207210
ajax::success($html);
208211
}
209212
}

core/ajax/user.ajax.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383

8484
if (init('action') == 'getApikey') {
8585
if (!login(init('username'), init('password'), init('twoFactorCode'))) {
86-
throw new Exception(__('Mot de passe ou nom d\'utilisateur incorrect'), __FILE__);
86+
throw new Exception(__('Mot de passe ou nom d\'utilisateur incorrect', __FILE__));
8787
}
8888
ajax::success($_SESSION['user']->getHash());
8989
}
@@ -229,7 +229,6 @@
229229
$_SESSION['user']->setLogin($login);
230230
$_SESSION['user']->save();
231231
@session_write_close();
232-
eqLogic::clearCacheWidget();
233232
ajax::success();
234233
}
235234

core/class/DB.class.php

+19-4
Original file line numberDiff line numberDiff line change
@@ -656,14 +656,18 @@ public static function compareTable($_table) {
656656
$return[$_table['name']]['sql'] .= static::buildDefinitionField($field);
657657
$return[$_table['name']]['sql'] .= ',';
658658
}
659-
$return[$_table['name']]['sql'] .= "\n" . 'primary key(';
659+
$primary_key = '';
660660
foreach ($_table['fields'] as $field) {
661661
if (isset($field['key']) && $field['key'] == 'PRI') {
662-
$return[$_table['name']]['sql'] .= '`' . $field['name'] . '`,';
662+
$primary_key .= '`' . $field['name'] . '`,';
663663
}
664664
}
665-
$return[$_table['name']]['sql'] = trim($return[$_table['name']]['sql'], ',');
666-
$return[$_table['name']]['sql'] .= ')';
665+
if($primary_key != ''){
666+
$return[$_table['name']]['sql'] .= "\n" . 'primary key(';
667+
$return[$_table['name']]['sql'] .= trim($primary_key, ',');
668+
$return[$_table['name']]['sql'] .= ')';
669+
}
670+
$return[$_table['name']]['sql'] = trim($return[$_table['name']]['sql'],',');
667671
$return[$_table['name']]['sql'] .= ')' . "\n";
668672
if (!isset($_table['engine'])) {
669673
$_table['engine'] = 'InnoDB';
@@ -676,6 +680,17 @@ public static function compareTable($_table) {
676680
return $return;
677681
}
678682
$forceRebuildIndex = false;
683+
try {
684+
$status = DB::Prepare('show table status where name="' . $_table['name'] . '"', array(), DB::FETCH_TYPE_ROW);
685+
} catch (\Exception $e) {
686+
$status = array();
687+
}
688+
if(!isset($_table['engine'])){
689+
$_table['engine'] = 'InnoDB';
690+
}
691+
if(isset($status['Engine']) && $status['Engine'] != $_table['engine']){
692+
$return[$_table['name']]['sql'] = 'ALTER TABLE `' . $_table['name'] . '` ENGINE = '.$_table['engine'];
693+
}
679694
foreach ($_table['fields'] as $field) {
680695
$found = false;
681696
foreach ($describes as $describe) {

0 commit comments

Comments
 (0)