ebal / flatpress_tag_plugin Goto Github PK
View Code? Open in Web Editor NEWTag Plugin for FlatPress v1.1
License: GNU General Public License v2.0
Tag Plugin for FlatPress v1.1
License: GNU General Public License v2.0
Hello all,
the plugin works very well with Smarty 4.
However, no new tags are written to the txt files in the fp-content/plugin_tag directory.
Impact: In a newly created post under PHP 8.1, no link to tag is displayed under the post anymore. In the widget, all previous tags are displayed; from posts created with PHP 7.4. I was able to reproduce the problem using PHP 8.1.23
Link to forum post
Tested with FlatPress 1.3.dev [master].
With best regards
Frank
Hello everyone,
A fatal error occurs if the entry is saved as a draft with at least one tag.
Setup:
PHP8.1, Apache/2.4.56 (Debian), FlatPress 1.3 commit 1005, FlatPress commit 1131
Possible source of the error:
flatpress_tag_plugin/tag/inc/entry.php
Line 203 in 7a665cf
Steps for reproducibility:
Output:
Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /var/www/html/flatpress-master-1131/fp-plugins/tag/inc/entry.php:203 Stack trace: #0 /var/www/html/flatpress-master-1131/fp-plugins/tag/inc/entry.php(235): plugin_tag_entry->smarty_modifier() #1 /var/www/html/flatpress-master-1131/fp-includes/core/core.wp-plugin-interface.php(54): plugin_tag_entry->tag_bottomlist() #2 /var/www/html/flatpress-master-1131/fp-includes/core/core.theme.php(282): apply_filters() #3 /var/www/html/flatpress-master-1131/fp-content/cache/e93fccb09cf8b04111b9595da102f3f4^03f9ca9b2f4f93f28119f02005895bbb122563ba_0.file.preview.tpl.php(38): theme_apply_filters_wrapper() #4 /var/www/html/flatpress-master-1131/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_template_resource_base.php(123): content_65a2ac069c19c4_82947477() #5 /var/www/html/flatpress-master-1131/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode() #6 /var/www/html/flatpress-master-1131/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_internal_template.php(217): Smarty_Template_Compiled->render() #7 /var/www/html/flatpress-master-1131/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_internal_template.php(386): Smarty_Internal_Template->render() #8 /var/www/html/flatpress-master-1131/fp-content/cache/e93fccb09cf8b04111b9595da102f3f4^1f7adbccfb8e329335e1539d0ce4e63da2e8be81_0.admin.entrywrite.php(49): Smarty_Internal_Template->_subTemplateRender() #9 /var/www/html/flatpress-master-1131/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_template_resource_base.php(123): content_65a2abb224d621_03767663() #10 /var/www/html/flatpress-master-1131/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode() #11 /var/www/html/flatpress-master-1131/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_internal_template.php(217): Smarty_Template_Compiled->render() #12 /var/www/html/flatpress-master-1131/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_internal_template.php(386): Smarty_Internal_Template->render() #13 /var/www/html/flatpress-master-1131/fp-content/cache/e93fccb09cf8b04111b9595da102f3f4^ce076dca0534e021a3d1962070b7d04ed33c3ead_0.file.main.tpl.php(89): Smarty_Internal_Template->_subTemplateRender() #14 /var/www/html/flatpress-master-1131/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_template_resource_base.php(123): content_659fe0ee417170_52864076() #15 /var/www/html/flatpress-master-1131/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode() #16 /var/www/html/flatpress-master-1131/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_internal_template.php(217): Smarty_Template_Compiled->render() #17 /var/www/html/flatpress-master-1131/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_internal_templatebase.php(238): Smarty_Internal_Template->render() #18 /var/www/html/flatpress-master-1131/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_internal_templatebase.php(134): Smarty_Internal_TemplateBase->_execute() #19 /var/www/html/flatpress-master-1131/admin/main.php(151): Smarty_Internal_TemplateBase->display() #20 /var/www/html/flatpress-master-1131/fp-content/cache/e93fccb09cf8b04111b9595da102f3f4^176eb26d3edd0d7d9a12d5300598090f26510b74_0.file.admin.tpl.php(54): showcontrolpanel() #21 /var/www/html/flatpress-master-1131/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_template_resource_base.php(123): content_659fe0ee372a96_67383435() #22 /var/www/html/flatpress-master-1131/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode() #23 /var/www/html/flatpress-master-1131/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_internal_template.php(217): Smarty_Template_Compiled->render() #24 /var/www/html/flatpress-master-1131/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_internal_templatebase.php(238): Smarty_Internal_Template->render() #25 /var/www/html/flatpress-master-1131/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_internal_templatebase.php(134): Smarty_Internal_TemplateBase->_execute() #26 /var/www/html/flatpress-master-1131/admin/main.php(191): Smarty_Internal_TemplateBase->display() #27 /var/www/html/flatpress-master-1131/admin.php(6): require('...') #28 {main} thrown in /var/www/html/flatpress-master-1131/fp-plugins/tag/inc/entry.php on line 203
Cached file:
<?php
/* Smarty version 4.3.1, created on 2024-01-13 15:28:06
from '/var/www/html/flatpress-master-1131/fp-interface/themes/leggero/preview.tpl' */
/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
'version' => '4.3.1',
'unifunc' => 'content_65a2ac069c19c4_82947477',
'has_nocache_code' => false,
'file_dependency' =>
array (
'03f9ca9b2f4f93f28119f02005895bbb122563ba' =>
array (
0 => '/var/www/html/flatpress-master-1131/fp-interface/themes/leggero/preview.tpl',
1 => 1704564988,
2 => 'file',
),
),
'includes' =>
array (
),
),false)) {
function content_65a2ac069c19c4_82947477 (Smarty_Internal_Template $_smarty_tpl) {
?> <?php $_block_plugin1 = isset($_smarty_tpl->smarty->registered_plugins['block']['entry'][0]) ? $_smarty_tpl->smarty->registered_plugins['block']['entry'][0] : null;
if (!is_callable($_block_plugin1)) {
throw new SmartyException('block tag \'entry\' not callable or registered');
}
$_smarty_tpl->smarty->_cache['_tag_stack'][] = array('entry', array('content'=>$_smarty_tpl->tpl_vars['entry']->value));
$_block_repeat=true;
echo $_block_plugin1(array('content'=>$_smarty_tpl->tpl_vars['entry']->value), null, $_smarty_tpl, $_block_repeat);
while ($_block_repeat) {
ob_start();?>
<div class="entry">
<?php echo call_user_func_array($_smarty_tpl->registered_plugins[ 'modifier' ][ 'date_format_daily' ][ 0 ], array( $_smarty_tpl->tpl_vars['date']->value,"<h6 class=\"date\">".((string)$_smarty_tpl->tpl_vars['fp_config']->value['locale']['dateformat'])."</h6>" ));?>
<h2 class="entry-title"><?php echo call_user_func_array($_smarty_tpl->registered_plugins[ 'modifier' ][ 'tag' ][ 0 ], array( $_smarty_tpl->tpl_vars['subject']->value,'the_title' ));?>
</h2>
<?php echo call_user_func_array($_smarty_tpl->registered_plugins[ 'modifier' ][ 'tag' ][ 0 ], array( $_smarty_tpl->tpl_vars['content']->value,'the_content' ));?>
<ul class="entry-footer">
<li class="entry-info">
<p class="date"><?php echo $_smarty_tpl->tpl_vars['lang']->value['entryauthor']['posted_by'];?>
<?php echo $_smarty_tpl->tpl_vars['author']->value;?>
<?php echo $_smarty_tpl->tpl_vars['lang']->value['entryauthor']['at'];?>
<?php echo call_user_func_array($_smarty_tpl->registered_plugins[ 'modifier' ][ 'date_format' ][ 0 ], array( $_smarty_tpl->tpl_vars['date']->value ));?>
</p>
</li>
</ul>
</div>
<?php $_block_repeat=false;
echo $_block_plugin1(array('content'=>$_smarty_tpl->tpl_vars['entry']->value), ob_get_clean(), $_smarty_tpl, $_block_repeat);
}
array_pop($_smarty_tpl->smarty->_cache['_tag_stack']);
}
}
<?php
/* Smarty version 4.3.1, created on 2024-01-13 15:26:42
from 'admin:entrywrite' */
/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
'version' => '4.3.1',
'unifunc' => 'content_65a2abb224d621_03767663',
'has_nocache_code' => false,
'file_dependency' =>
array (
'1f7adbccfb8e329335e1539d0ce4e63da2e8be81' =>
array (
0 => 'admin:entrywrite',
1 => 1704661607,
2 => 'admin',
),
),
'includes' =>
array (
'shared:errorlist.tpl' => 1,
'file:preview.tpl' => 1,
'plugin:bbcode/toolbar' => 1,
),
),false)) {
function content_65a2abb224d621_03767663 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_checkPlugins(array(0=>array('file'=>'/var/www/html/flatpress-master-1131/fp-includes/fp-smartyplugins/block.html_form.php','function'=>'smarty_block_html_form',),1=>array('file'=>'/var/www/html/flatpress-master-1131/fp-includes/fp-smartyplugins/function.list_categories.php','function'=>'smarty_function_list_categories',),2=>array('file'=>'/var/www/html/flatpress-master-1131/fp-includes/fp-smartyplugins/function.html_submit.php','function'=>'smarty_function_html_submit',),));
?>
<h2><?php echo $_smarty_tpl->tpl_vars['panelstrings']->value['head'];?>
</h2>
<?php $_smarty_tpl->_subTemplateRender("shared:errorlist.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>
<?php $_block_plugin1 = isset($_smarty_tpl->smarty->registered_plugins['block']['entry_block'][0]) ? $_smarty_tpl->smarty->registered_plugins['block']['entry_block'][0] : null;
if (!is_callable($_block_plugin1)) {
throw new SmartyException('block tag \'entry_block\' not callable or registered');
}
$_smarty_tpl->smarty->_cache['_tag_stack'][] = array('entry_block', array());
$_block_repeat=true;
echo $_block_plugin1(array(), null, $_smarty_tpl, $_block_repeat);
while ($_block_repeat) {
ob_start();?>
<div id="admin-post-preview">
<?php if ((isset($_smarty_tpl->tpl_vars['preview']->value))) {?>
<fieldset id="post-preview"><legend><?php echo $_smarty_tpl->tpl_vars['panelstrings']->value['preview'];?>
</legend>
<?php $_smarty_tpl->_subTemplateRender("file:preview.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>
</fieldset>
<?php }?>
</div>
<?php $_smarty_tpl->smarty->_cache['_tag_stack'][] = array('html_form', array());
$_block_repeat=true;
echo smarty_block_html_form(array(), null, $_smarty_tpl, $_block_repeat);
while ($_block_repeat) {
ob_start();?>
<?php if (!(isset($_smarty_tpl->tpl_vars['post']->value))) {?>
<?php $_smarty_tpl->_assignInScope('post', '');?>
<?php }?>
<?php $_block_plugin2 = isset($_smarty_tpl->smarty->registered_plugins['block']['entry'][0]) ? $_smarty_tpl->smarty->registered_plugins['block']['entry'][0] : null;
if (!is_callable($_block_plugin2)) {
throw new SmartyException('block tag \'entry\' not callable or registered');
}
$_smarty_tpl->smarty->_cache['_tag_stack'][] = array('entry', array('content'=>$_smarty_tpl->tpl_vars['post']->value,'alwaysshow'=>true));
$_block_repeat=true;
echo $_block_plugin2(array('content'=>$_smarty_tpl->tpl_vars['post']->value,'alwaysshow'=>true), null, $_smarty_tpl, $_block_repeat);
while ($_block_repeat) {
ob_start();?>
<!-- BOF Datechanger- Plugin --><?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['action'][0], array( array('hook'=>'simple_datechanger_form'),$_smarty_tpl ) );?>
<!-- EOF Datechanger- Plugin -->
<div id="admin-editor">
<p><label for="subject"><?php echo $_smarty_tpl->tpl_vars['panelstrings']->value['subject'];?>
</label><br>
<?php if ((isset($_smarty_tpl->tpl_vars['error']->value)) && (isset($_smarty_tpl->tpl_vars['error']->value['subject'])) && !empty($_smarty_tpl->tpl_vars['error']->value['subject'])) {?>
<?php $_smarty_tpl->_assignInScope('class', "field-error");?>
<?php } else { ?>
<?php $_smarty_tpl->_assignInScope('class', '');?>
<?php }?>
<input type="text" name="subject" id="subject" class="<?php echo $_smarty_tpl->tpl_vars['class']->value;?>
"
value="<?php ob_start();
echo (($tmp = $_REQUEST['subject'] ?? null)===null||$tmp==='' ? '' ?? null : $tmp);
$_prefixVariable1 = ob_get_clean();
echo call_user_func_array($_smarty_tpl->registered_plugins[ 'modifier' ][ 'wp_specialchars' ][ 0 ], array( (($tmp = $_smarty_tpl->tpl_vars['subject']->value ?? null)===null||$tmp==='' ? $_prefixVariable1 ?? null : $tmp),1 ));?>
"><br>
<input type="hidden" name="timestamp" value="<?php echo $_smarty_tpl->tpl_vars['date']->value;?>
">
<input type="hidden" name="entry" value="<?php echo $_smarty_tpl->tpl_vars['id']->value;?>
">
</p>
<p>
<label for="content"><?php echo $_smarty_tpl->tpl_vars['panelstrings']->value['content'];?>
</label>
</p>
<?php if (function_exists('plugin_bbcode_init')) {?>
<?php $_smarty_tpl->_subTemplateRender("plugin:bbcode/toolbar", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>
<?php }?>
<p>
<?php if ((isset($_smarty_tpl->tpl_vars['error']->value)) && (isset($_smarty_tpl->tpl_vars['error']->value['content'])) && !empty($_smarty_tpl->tpl_vars['error']->value['content'])) {?>
<?php $_smarty_tpl->_assignInScope('class', "field-error");?>
<?php } else { ?>
<?php $_smarty_tpl->_assignInScope('class', '');?>
<?php }?>
<textarea name="content" id="content" class="<?php echo $_smarty_tpl->tpl_vars['class']->value;?>
"
rows="20" cols="74"><?php ob_start();
echo (($tmp = $_REQUEST['content'] ?? null)===null||$tmp==='' ? '' ?? null : $tmp);
$_prefixVariable2 = ob_get_clean();
echo call_user_func_array($_smarty_tpl->registered_plugins[ 'modifier' ][ 'htmlspecialchars' ][ 0 ], array( (($tmp = $_smarty_tpl->tpl_vars['content']->value ?? null)===null||$tmp==='' ? $_prefixVariable2 ?? null : $tmp) ));?>
</textarea><br>
</p>
</div>
<!-- BOF SEO-Metataginfo- Plugin --><?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['action'][0], array( array('hook'=>'simple_metatag_info'),$_smarty_tpl ) );?>
<!-- EOF SEO-Metataginfo- Plugin -->
<!-- BOF Tag- Plugin --><?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['action'][0], array( array('hook'=>'simple_tag_form'),$_smarty_tpl ) );?>
<!-- EOF Tag- Plugin -->
<!-- BOF CommentCenter- Plugin --><?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['action'][0], array( array('hook'=>'simple_edit_form'),$_smarty_tpl ) );?>
<!-- EOF CommentCenter- Plugin -->
<div id="admin-options">
<fieldset id="admin-entry-categories"><legend><?php echo $_smarty_tpl->tpl_vars['panelstrings']->value['categories'];?>
</legend>
<?php echo smarty_function_list_categories(array('type'=>'form','selected'=>$_smarty_tpl->tpl_vars['categories']->value),$_smarty_tpl);?>
</fieldset>
<fieldset id="admin-entry-saveopts"><legend><?php echo $_smarty_tpl->tpl_vars['panelstrings']->value['saveopts'];?>
</legend>
<p>
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['saved_flags']->value, 'flag');
$_smarty_tpl->tpl_vars['flag']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['flag']->value) {
$_smarty_tpl->tpl_vars['flag']->do_else = false;
?>
<label><input name="flags[<?php echo $_smarty_tpl->tpl_vars['flag']->value;?>
]"<?php if ($_smarty_tpl->tpl_vars['categories']->value && (bool)array_intersect(array($_smarty_tpl->tpl_vars['flag']->value),$_smarty_tpl->tpl_vars['categories']->value)) {?>checked="checked"<?php }?> type="checkbox"><?php echo $_smarty_tpl->tpl_vars['lang']->value['entry']['flags']['long'][$_smarty_tpl->tpl_vars['flag']->value];?>
</label><br>
<?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</p>
</fieldset>
</div>
<div class="buttonbar">
<?php echo smarty_function_html_submit(array('name'=>"save",'id'=>"save",'value'=>$_smarty_tpl->tpl_vars['panelstrings']->value['submit'],'accesskey'=>'s'),$_smarty_tpl);?>
<?php echo smarty_function_html_submit(array('name'=>"savecontinue",'id'=>"savecontinue",'value'=>$_smarty_tpl->tpl_vars['panelstrings']->value['savecontinue'],'accesskey'=>'c'),$_smarty_tpl);?>
<?php echo smarty_function_html_submit(array('name'=>"preview",'id'=>"preview",'value'=>$_smarty_tpl->tpl_vars['panelstrings']->value['preview'],'accesskey'=>'p'),$_smarty_tpl);?>
</div>
<?php $_block_repeat=false;
echo $_block_plugin2(array('content'=>$_smarty_tpl->tpl_vars['post']->value,'alwaysshow'=>true), ob_get_clean(), $_smarty_tpl, $_block_repeat);
}
array_pop($_smarty_tpl->smarty->_cache['_tag_stack']);
$_block_repeat=false;
echo smarty_block_html_form(array(), ob_get_clean(), $_smarty_tpl, $_block_repeat);
}
array_pop($_smarty_tpl->smarty->_cache['_tag_stack']);?>
<?php $_block_repeat=false;
echo $_block_plugin1(array(), ob_get_clean(), $_smarty_tpl, $_block_repeat);
}
array_pop($_smarty_tpl->smarty->_cache['_tag_stack']);?>
<?php if ((isset($_GET['entry']))) {?>
<div id="admin-otheroptions">
<h2><?php echo $_smarty_tpl->tpl_vars['panelstrings']->value['otheropts'];?>
</h2>
<ul>
<?php if (!(isset($_smarty_tpl->tpl_vars['draft']->value))) {?>
<li><a href="admin.php?p=entry&entry=<?php echo $_GET['entry'];?>
&action=commentlist">
<?php echo $_smarty_tpl->tpl_vars['panelstrings']->value['commmsg'];?>
</a></li>
<?php }?>
<li><a href="admin.php?p=entry&entry=<?php echo $_GET['entry'];?>
&action=delete">
<?php echo $_smarty_tpl->tpl_vars['panelstrings']->value['delmsg'];?>
</a></li>
</ul>
</div>
<?php }
}
}
With best regards
Frank
Hello, everyone,
when trying to activate the plugin tag under FlatPress 1.3dev [master], I get the following error message:
This page does not work frank-web.dedyn.io is currently unable to process this request.
HTTP ERROR 500
Strangely, there is no error found in the log files (syslog and apache error.log).
Apache/2.4.54
PHP 7.4.30 FPM/FastCGI
Maybe someone would like to take a look and confirm that the error exists. Maybe also with abnormalities in the log files.
Under Smarty 2.6 the plugin works perfectly.
It would be a shame if this plugin didn't work with Smarty 4.
Best Regards
Frank
Hello all,
in the course of the correction for Smarty 4 I recommend to add the files for German language.
I will gladly provide the appropriate files.
With best regards
Frank
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.