Problems with plugin Staticpage

Found a bug? Tell us!!
Post Reply
orinoco
Posts: 1
Joined: Sun Aug 20, 2023 6:03 pm

Problems with plugin Staticpage

Post by orinoco »

Hello everyone,

I have updated a very old Serendipity version 2.1.1 to the current version 2.4.0. The operating system is Debian Bookworm (PHP 8.2, MariaDB 10.11.3).

The update went without error messages and Serendipity ran without any obvious problems. When I then installed the Staticpages plugin, the blog suddenly stopped working. When calling the start page comes only a white page.

Here is the error message:

Code: Select all

Uncaught mysqli_sql_exception: Table 'blog.blog_staticpage_categorypage' doesn't exist in /var/www/www.example.com/htdocs/blog/include/db/mysqli.inc.php:68
Stack trace:
#0 /var/www/www.example.com/htdocs/blog/include/db/mysqli.inc.php(68): mysqli_query()
#1 /var/www/www.example.com/htdocs/blog/plugins/serendipity_event_staticpage/serendipity_event_staticpage.php(2910): serendipity_db_query()
#2 /var/www/www.example.com/htdocs/blog/plugins/serendipity_event_staticpage/serendipity_event_staticpage.php(1135): serendipity_event_staticpage->fetchCatProp()
#3 /var/www/www.example.com/htdocs/blog/plugins/serendipity_event_staticpage/serendipity_event_staticpage.php(3043): serendipity_event_staticpage->smarty_init()
#4 /var/www/www.example.com/htdocs/blog/include/plugin_api.inc.php(1188): serendipity_event_staticpage->event_hook()
#5 /var/www/www.example.com/htdocs/blog/include/functions_entries.inc.php(356): serendipity_plugin_api::hook_event()
#6 /var/www/www.example.com/htdocs/blog/include/admin...', referer: https://www.example.com/blog/serendipity_admin.php
Apparently the table "blog.blog_staticpage_categorypage" is really missing:

Code: Select all

MariaDB [blog]> show tables;
+------------------------+
| Tables_in_blog         |
+------------------------+
| blog_access            |
| blog_authorgroups      |
| blog_authors           |
| blog_category          |
| blog_comments          |
| blog_config            |
| blog_entries           |
| blog_entrycat          |
| blog_entryproperties   |
| blog_groupconfig       |
| blog_groups            |
| blog_images            |
| blog_mediaproperties   |
| blog_options           |
| blog_permalinks        |
| blog_plugincategories  |
| blog_pluginlist        |
| blog_plugins           |
| blog_references        |
| blog_referrers         |
| blog_refs              |
| blog_staticpages       |
| blog_staticpages_types |
| blog_suppress          |
| blog_visitors          |
| blog_visitors_count    |
| blog_wikireferences    |
+------------------------+
In the source serendipity_event_staticpage.php I found the following section:

Code: Select all

case 16:
    $this->pagetype = array(
        'description' => 'Staticpage with related category',
        'template'    => 'plugin_staticpage_related_category.tpl'
    );
    serendipity_db_insert('staticpages_types', $this->pagetype);

    $sql = 'CREATE TABLE IF NOT EXISTS '.$serendipity['dbPrefix'].'staticpage_categorypage (
                categoryid int(4) default 0,
                staticpage_categorypage int(4) default 0
            ) {UTF_8}';
    serendipity_db_schema_import($sql);
Apparently the code was not executed successfully. I fear that more SQL commands were not executed correctly.

I helped myself for now by renaming the plugin folder "serendipity_event_staticpage". So at least the start page starts again and I can access the backend.

Is the behavior known? How do I get the plugin staticpage included correctly? Should I create the table(s) manually?

Any tips are appreciated.

Edit: Typo fixed
onli
Regular
Posts: 2829
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Problems with plugin Staticpage

Post by onli »

Hi
Thanks for your report! This bug is not known, and I wasn't able to reproduce it so far. Maybe we get additional insight if this fails for more users.

But so far I'd recommend that you really should create the table manually. The plugin should start to work.

You are right, if this table is missing it is likely the SQL statements below were also not run, that would include the staticpage_custom table from the next code part. However, the plugin calls this code repeatedly, if you create the table and this fixes the crash it is possible that the plugin will continue to create the missing tables on its own.

Edit: The problem might stem from PHP 8.2, if you could switch to PHP 8.1 for now that could help.
Post Reply