This commit is contained in:
Jean-Christian Denis 2022-12-23 15:53:17 +01:00
parent d8dd602fd2
commit 50bdbd4f53
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951
2 changed files with 5 additions and 8 deletions

View file

@ -24,8 +24,8 @@ try {
}
// Table is the same for plugins pollsFactory, postTask, postWidgetText
$s = new dbStruct(dcCore::app()->con, dcCore::app()->prefix);
$s->{initPostWidgetText::PWT_TABLE_NAME}
$st = new dbStruct(dcCore::app()->con, dcCore::app()->prefix);
$st->{initPostWidgetText::PWT_TABLE_NAME}
->option_id('bigint', 0, false)
->post_id('bigint', 0, false)
->option_creadt('timestamp', 0, false, 'now()')
@ -42,7 +42,7 @@ try {
->index('idx_post_option_type', 'btree', 'option_type');
$si = new dbStruct(dcCore::app()->con, dcCore::app()->prefix);
$changes = $si->synchronize($s);
$changes = $si->synchronize($st);
$current = dcCore::app()->getVersion(basename(__DIR__));

View file

@ -53,11 +53,8 @@ class postWidgetTextWidget
public static function display($w)
{
if ($w->offline) {
return null;
}
if (!dcCore::app()->blog->settings->get(basename(__DIR__))->get('active')
if ($w->offline
|| !dcCore::app()->blog->settings->get(basename(__DIR__))->get('active')
|| !dcCore::app()->ctx->exists('posts')
|| !dcCore::app()->ctx->__get('posts')->post_id
) {