Skip to content
Snippets Groups Projects
Commit 33d05907 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

fix sql error when diffing mvv entities and adjust cache location, fixes #999

Closes #999
parent 84baca6b
No related branches found
No related tags found
No related merge requests found
...@@ -1118,6 +1118,9 @@ class Module_ModuleController extends MVVController ...@@ -1118,6 +1118,9 @@ class Module_ModuleController extends MVVController
$type_old = 2; $type_old = 2;
} }
$diff_config = new Caxy\HtmlDiff\HtmlDiffConfig();
$diff_config->setPurifierCacheLocation($GLOBALS['TMP_PATH']);
PageLayout::setTitle(_('Vergleichsansicht')); PageLayout::setTitle(_('Vergleichsansicht'));
PageLayout::addStylesheet('print.css'); PageLayout::addStylesheet('print.css');
$factory = $this->get_template_factory(); $factory = $this->get_template_factory();
...@@ -1128,7 +1131,8 @@ class Module_ModuleController extends MVVController ...@@ -1128,7 +1131,8 @@ class Module_ModuleController extends MVVController
'old_module' => $old_module, 'old_module' => $old_module,
'type_new' => $type_new, 'type_new' => $type_new,
'type_old' => $type_old, 'type_old' => $type_old,
'plugin' => $this->plugin 'plugin' => $this->plugin,
'diff_config' => $diff_config,
]); ]);
$this->render_text($template->render()); $this->render_text($template->render());
......
...@@ -127,7 +127,7 @@ class Shared_LogEventController extends MVVController ...@@ -127,7 +127,7 @@ class Shared_LogEventController extends MVVController
LEFT JOIN `log_actions` ON `log_events`.`action_id` = `log_actions`.`action_id` LEFT JOIN `log_actions` ON `log_events`.`action_id` = `log_actions`.`action_id`
WHERE `info` = ? WHERE `info` = ?
" . $search_action . " " . $search_action . "
ORDER BY `mkdate` DESC"); ORDER BY `log_events`.`mkdate` DESC");
$statement->execute([$mvv_field]); $statement->execute([$mvv_field]);
$res = $statement->fetchOne(); $res = $statement->fetchOne();
if ($res) { if ($res) {
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<?php <?php
$old = $this->render_partial('shared/modul/_modul', ['modul' => $old_module]); $old = $this->render_partial('shared/modul/_modul', ['modul' => $old_module]);
$new = $this->render_partial('shared/modul/_modul', ['modul' => $new_module]); $new = $this->render_partial('shared/modul/_modul', ['modul' => $new_module]);
$diff = new Caxy\HtmlDiff\HtmlDiff($old, $new); $diff = Caxy\HtmlDiff\HtmlDiff::create($old, $new, $diff_config);
$diff->build(); $diff->build();
echo $diff->getDifference(); echo $diff->getDifference();
?> ?>
...@@ -77,19 +77,19 @@ ...@@ -77,19 +77,19 @@
<?php <?php
$old = $this->render_partial('shared/modul/_modullvs', ['modul' => $old_module]); $old = $this->render_partial('shared/modul/_modullvs', ['modul' => $old_module]);
$new = $this->render_partial('shared/modul/_modullvs', ['modul' => $new_module]); $new = $this->render_partial('shared/modul/_modullvs', ['modul' => $new_module]);
$diff = new Caxy\HtmlDiff\HtmlDiff($old, $new); $diff = Caxy\HtmlDiff\HtmlDiff::create($old, $new, $diff_config);
$diff->build(); $diff->build();
echo $diff->getDifference(); echo $diff->getDifference();
$old = $this->render_partial('shared/modul/_pruefungen', ['modul' => $old_module]); $old = $this->render_partial('shared/modul/_pruefungen', ['modul' => $old_module]);
$new = $this->render_partial('shared/modul/_pruefungen', ['modul' => $new_module]); $new = $this->render_partial('shared/modul/_pruefungen', ['modul' => $new_module]);
$diff = new Caxy\HtmlDiff\HtmlDiff($old, $new); $diff = Caxy\HtmlDiff\HtmlDiff::create($old, $new, $diff_config);
$diff->build(); $diff->build();
echo $diff->getDifference(); echo $diff->getDifference();
$old = $this->render_partial('shared/modul/_regularien', ['modul' => $old_module]); $old = $this->render_partial('shared/modul/_regularien', ['modul' => $old_module]);
$new = $this->render_partial('shared/modul/_regularien', ['modul' => $new_module]); $new = $this->render_partial('shared/modul/_regularien', ['modul' => $new_module]);
$diff = new Caxy\HtmlDiff\HtmlDiff($old, $new); $diff = Caxy\HtmlDiff\HtmlDiff::create($old, $new, $diff_config);
$diff->build(); $diff->build();
echo $diff->getDifference(); echo $diff->getDifference();
?> ?>
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
<? <?
$old = $this->render_partial('shared/modul/_modullv', ['modul' => $old_module]); $old = $this->render_partial('shared/modul/_modullv', ['modul' => $old_module]);
$new = $this->render_partial('shared/modul/_modullv', ['modul' => $new_module]); $new = $this->render_partial('shared/modul/_modullv', ['modul' => $new_module]);
$diff = new Caxy\HtmlDiff\HtmlDiff($old, $new); $diff = Caxy\HtmlDiff\HtmlDiff::create($old, $new, $diff_config);
$diff->build(); $diff->build();
echo $diff->getDifference(); echo $diff->getDifference();
?> ?>
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
<?php <?php
$old = $this->render_partial('shared/modul/_modul_ohne_lv', ['modul' => $old_module]); $old = $this->render_partial('shared/modul/_modul_ohne_lv', ['modul' => $old_module]);
$new = $this->render_partial('shared/modul/_modul_ohne_lv', ['modul' => $new_module]); $new = $this->render_partial('shared/modul/_modul_ohne_lv', ['modul' => $new_module]);
$diff = new Caxy\HtmlDiff\HtmlDiff($old, $new); $diff = Caxy\HtmlDiff\HtmlDiff::create($old, $new, $diff_config);
$diff->build(); $diff->build();
echo $diff->getDifference(); echo $diff->getDifference();
?> ?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment