Skip to content

Commit 3cdd573

Browse files
committed
fix: impostazione base url
1 parent 839f0af commit 3cdd573

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

core.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,3 @@
321321
$lang = Models\Locale::find($id_lang)->language_code;
322322
$translator->setLocale($lang, $formatter);
323323
}
324-
325-
if (!setting('Base URL') && $_SERVER['HTTP_HOST']) {
326-
Settings::setValue('Base URL', base_url());
327-
}

update/2_9_5.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
Settings::setValue('Base URL', base_url());

update/2_9_5.sql

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ INSERT INTO `zz_prints_lang` (`id_lang`, `id_record`, `title`, `filename`) VALUE
8484
INSERT INTO `zz_prints_lang` (`id_lang`, `id_record`, `title`, `filename`) VALUES ('2', (SELECT MAX(`id`) FROM `zz_prints`), 'Intervento & checklist con note', 'Intervento num {numero} del {data}');
8585

8686
-- Aggiunta impostazione per Base URL
87-
INSERT INTO `zz_settings` (`id`, `nome`, `valore`, `tipo`, `editable`, `sezione`, `created_at`, `updated_at`, `order`, `is_user_setting`) VALUES (NULL, 'Base URL', '', 'string', '0', 'Generali', NULL, NULL, NULL, '0');
88-
SELECT @id_setting := MAX(`id`) FROM `zz_settings`;
87+
INSERT INTO `zz_settings` (`nome`, `valore`, `tipo`, `editable`, `sezione`, `order`, `is_user_setting`) VALUES ('Base URL', '', 'string', '0', 'Generali', NULL, '0');
8988
INSERT INTO `zz_settings_lang` (`id_lang`, `id_record`, `title`, `help`) VALUES
90-
(1, @id_setting, 'Base URL', ''),
91-
(2, @id_setting, 'Base URL', '');
89+
(1, (SELECT MAX(`id`) FROM `zz_settings`), 'Base URL', ''),
90+
(2, (SELECT MAX(`id`) FROM `zz_settings`), 'Base URL', '');

0 commit comments

Comments
 (0)