Uncaught TypeError: Unsupported operand types

@WikiAdmin Uhmm...So it's probably a stupid question. As I pointed out in my previous comment, I lost all the data from my wiki site, including the database. And I didn't have time to rebuild my site until the last few days. I seem to have had to do an upgrade, but I couldn't because of the lost database tables. Is there any way to allow me to do a re-install rather than a version upgrade?
Updated: I found an old copy of the database files on my local device and I uploaded it to my new database, so the wiki site has been online. However, when I try to save my article after edited, I will get an Error 500 page. How can I debug and fix it?


Thanks.

Comments

  1. 回复: Uncaught TypeError: Unsupported operand types

    Hello.

    I copied the apache logs here. I don't know how to find deeper reasons based on these. Can you help?

    error.log
    [Mon Jan 30 05:04:50.767414 2023] [php:error] [pid 22208] [client 39.183.131.210:57852] PHP Fatal error:  Uncaught TypeError: Unsupported operand types: int - string in /home/admin/web/wiki.koushitsu.divvp.space/public_html/handler/page/edit.php:148\nStack trace:\n#0 /home/admin/web/wiki.koushitsu.divvp.space/public_html/class/wacko.php(5080): include()\n#1 /home/admin/web/wiki.koushitsu.divvp.space/public_html/class/wacko.php(5159): Wacko->include_buffered()\n#2 /home/admin/web/wiki.koushitsu.divvp.space/public_html/class/wacko.php(7355): Wacko->method()\n#3 /home/admin/web/wiki.koushitsu.divvp.space/public_html/index.php(62): Wacko->run()\n#4 {main}\n  thrown in /home/admin/web/wiki.koushitsu.divvp.space/public_html/handler/page/edit.php on line 148, referer: https://wiki.koushitsu.divvp.space/%E9%A6%96%E9%A1%B5/edit	
    • Capixo
    • 04.02.2023 12:37 edited
  2. 回复: Does wackowiki allow users to use templates

    @WikiAdmin Umm…Maybe I have a related additional discovery about the error. Just minutes ago, I tried to edit my user page and.get.the same error. Will it because of the lack of user's permission? Thank you.
  3. Re: Uncaught TypeError: Unsupported operand types

    The following line is missing in your config_defaults.php
    'max_page_size'					=> 2048 * 1024,	


    It is very likely that you have just a older version of this file in your config folder. This is causing the Unsupported operand types error.

    Please replace the old version of the file with the new one and this should solve the issue.
  4. Re: Uncaught TypeError: Unsupported operand types

    It is only this file and the missing parameter from above, that's all.
    config/config_defaults.php


    And purge the config cache via the admincache action or manually.
    _cache/config/config.php
    • WikiAdmin
    • 09.02.2023 14:33 edited
  5. Re: Uncaught TypeError: Unsupported operand types

    To narrow down the error source:

    PHP Fatal error:  Uncaught TypeError: Unsupported operand types: int - string in /wiki/handler/page/edit.php:148	


    The following lines throwing the Fatal error because of the missing config value.

    handler/page/edit.php #Line 148
    
    <?php
    // check text length
    if ($text_size $this->db->max_page_size)
    {
        
    $message Ut::perc_replace(
            
    $this->_t('TextDbOversize'),
            
    '<code>' number_format($text_size $this->db->max_page_size0',''.') . '</code>');
        
    $this->set_message($message 'error');
        
    $error true;
    }


    This check is not critical, so you can comment out the entire if {} enclosure or you add the missing parameter to your config array.

    The config array is created by reading first the config_defaults.php then the config table, and it merges both arrays so that every parameter present in the config table replaces the default values. This config array is then written in the _cache/config/ folder.

    Now if a parameter is missing, then it is neighter in the config_default.php nor the config table, or the cached config still has the old values and must be updated.

    config_defaults.php
    'max_page_size'					=> 2048 * 1024,	


    You can add it by hand or copy the linked version into your config folder.
    • WikiAdmin
    • 09.02.2023 14:48 edited
Log in or create an account to post a comment.