Announcement

Collapse
No announcement yet.

CSS issues

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Bug / Issue] CSS issues

    Hi Team,

    We have struggled to use php 8.1 on our forum since the 5.6.5 upgrade, and still the same issue with 5.6.6

    I have done a fresh clean vb install and confirm our system runs the vanilla install OK. However, on our pre-existing forum we get a HTTP 500 error on any call to "css.php" when inspecting in Chrome, as well as getting "An unexpected error was returned: 'Cannot access offset of type string on string'" when trying to access admincp.

    when i manually run php8.1 -f css.php inside the core directory, i get this:

    Code:
    PHP Warning: Undefined array key "sheet" in /home/gw_vb5/public_html/core/css.php on line 34
    PHP Warning: Undefined array key "styleid" in /home/gw_vb5/public_html/core/css.php on line 38
    PHP Warning: Undefined array key "td" in /home/gw_vb5/public_html/core/css.php on line 41
    PHP Warning: Trying to access array offset on value of type bool in phar:///home/gw_vb5/public_html/core/vb/vb.phar/request/web.php on line 198
    PHP Warning: Undefined array key "host" in phar:///home/gw_vb5/public_html/core/vb/vb.phar/request/web.php on line 273
    PHP Warning: Undefined array key "host" in phar:///home/gw_vb5/public_html/core/vb/vb.phar/request/web.php on line 275
    <b>API Error</b><br><b>Error:</b> invalidid<br><b>Args:</b><br><pre style="font-family:Lucida Console,Monaco5,monospace;font-size:small;overflow:auto;border:1px solid #CCC;">array (
    0 =&gt; &#039;styleid&#039;,
    )</pre>
    Does this help at all? We are trying to track down where in our templates or config this issue is arising from.

    Many thanks!

  • #2
    vBulletin 5.6.5 is not certified to run under PHP 8.1. Only vBulletin 5.6.6 is certified for PHP 8.1. If you have third-party code and add-on products, you must make sure they are properly tested to work with PHP 8.1 as well.

    Styleid and sheet are required in the call to css.php. Otherwise, it doesn't know which template to render. In addition to this, sheet can be an array. Due to this, calling it directly doesn't really help much because it will fail if you just call /core/css.php or /css.php. This is what the above is showing.

    What we really need is the error output from the 500 server error. This should be logged in your httpd and PHP error logs.

    However, you can remove the use of css.php by storing your CSS in the file system under Settings → Options → Style & Language Options. This will render the CSS files once and write them to the directory specified. The default in 5.6.6 is /core/cache/css. This directory should be chmod 777. This is also a performance boost since the system doesn't have to render the CSS on every page load and the files are more likely to be properly cached on the end user's device.

    For the AdminCP issue, I need to see the specific text of the message. This should be in your PHP error log if you're using the default logging settings.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API

    Comment


    • #3
      Thanks Wayne

      in admincp i always see
      Code:
      Warning: Illegal string offset 'cssdate' in .../includes/functions.php on line 2897
      Additionally, when i try and activate styles to be stored in the file system i get this:

      vBulletin Options
      Warning: Illegal string offset 'optionsdate' in phar://.../vb/vb.phar/datastore.php on line 746 Warning: Illegal string offset 'tmtdate' in phar://.../vb/vb.phar/library/template.php on line 227
      Rebuild Style Information
      Updating Style Information for 'MASTER STYLE' and child styles...
        • Default vB5 Style ... (Templates) Warning: Illegal string offset 'cssdate' in .../includes/functions.php on line 2897 Warning: Illegal string offset 'cssfiledate' in phar://.../vb/vb.phar/library/style.php on line 1530 Warning: Illegal string offset 'cssfiledate' in phar://.../vb/vb.phar/library/style.php on line 1533
          System Message

          An unexpected error was returned: 'Cannot use string offset as an array'

      Comment


      • #4
        Hmmm... In none of the locations listed are the variables actually strings.
        • In core/vb/library/style.php at line 1530, the system is creating an array to hold a list of dates from the timenow() function.
        • In core/vb/library/style.php at line 1533, the system is filling this array with the timenow() function.
        • In core/includes/functions.php at line 2897, it is converting the date created by the above into an integer value.

        Please do this....
        1. Go to https://members.vbulletin.com
        2. Click on Download vBulletin 5 Connect.
        3. Select "More Download Options"
        4. Select "File Options: Customize"
        5. Select "No Phar"
        6. Replace the /core/vb directory on your server with the contents of the /core/vb directory in the new download.
          1. Delete the contents of the /core/vb directory.
          2. Upload the new files.

        After this are you still getting warnings?
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API

        Comment


        • #5
          Hi Wayne,

          Thanks - using the non compressed files i still see similar errors

          If i turn on display_errors = On, AdminCP shows a blank white page even with PHP 7.4.27

          Code:
          Warning: Illegal string offset 'cssdate' in .../includes/functions.php on line 2897
          Again, using PHP 7.4.27 or PHP 8.1.2 when i enable the CSS & Template caching, all my CSS files return a 404 and the forum style is broken.

          When I disable the css/template caching, the Forum renders fine on PHP 7.4.27, but broken on PHP 8.1.2

          This is the output from the css page/url under PHP 8.1.2:

          Warning: Trying to access array offset on value of type bool in /home/gw_vb5/public_html/includes/vb5/template.php(404) : eval()'d code on line 4 Warning: Trying to access array offset on value of type bool in /home/gw_vb5/public_html/includes/vb5/template.php(404) : eval()'d code on line 22 Warning: Undefined variable $navbarItemCount in /home/gw_vb5/public_html/includes/vb5/template.php(404) : eval()'d code on line 322 Warning: Undefined variable $idx in /home/gw_vb5/public_html/includes/vb5/template.php(404) : eval()'d code on line 322 Warning: Undefined variable $navbarItemCount in /home/gw_vb5/public_html/includes/vb5/template.php(404) : eval()'d code on line 333 Warning: Undefined variable $idx in /home/gw_vb5/public_html/includes/vb5/template.php(404) : eval()'d code on line 333 Warning: Undefined variable $navbarItemCount in /home/gw_vb5/public_html/includes/vb5/template.php(404) : eval()'d code on line 344 Warning: Undefined variable $idx in /home/gw_vb5/public_html/includes/vb5/template.php(404) : eval()'d code on line 344 Warning: Undefined variable $navbarItemCount in /home/gw_vb5/public_html/includes/vb5/template.php(404) : eval()'d code on line 355 Warning: Undefined variable $idx in /home/gw_vb5/public_html/includes/vb5/template.php(404) : eval()'d code on line 355 Warning: Undefined variable $navbarItemCount in /home/gw_vb5/public_html/includes/vb5/template.php(404) : eval()'d code on line 366 Warning: Undefined variable $idx in /home/gw_vb5/public_html/includes/vb5/template.php(404) : eval()'d code on line 366 Warning: Undefined variable $navbarItemCount in /home/gw_vb5/public_html/includes/vb5/template.php(404) : eval()'d code on line 377 Warning: Undefined variable $idx in /home/gw_vb5/public_html/includes/vb5/template.php(404) : eval()'d code on line 377 Warning: Undefined variable $navbarItemCount in /home/gw_vb5/public_html/includes/vb5/template.php(404) : eval()'d code on line 388 Warning: Undefined variable $idx in /home/gw_vb5/public_html/includes/vb5/template.php(404) : eval()'d code on line 388 Warning: Undefined variable $navbarItemCount in /home/gw_vb5/public_html/includes/vb5/template.php(404) : eval()'d code on line 399 Warning: Undefined variable $idx in /home/gw_vb5/public_html/includes/vb5/template.php(404) : eval()'d code on line 399 Warning: Undefined variable $navbarItemCount in /home/gw_vb5/public_html/includes/vb5/template.php(404) : eval()'d code on line 410 Warning: Undefined variable $idx in /home/gw_vb5/public_html/includes/vb5/template.php(404) : eval()'d code on line 410 Warning: Undefined variable $navbarItemCount in /home/gw_vb5/public_html/includes/vb5/template.php(404) : eval()'d code on line 421 Warning: Undefined variable $idx in /home/gw_vb5/public_html/includes/vb5/template.php(404) : eval()'d code on line 421 Notice: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/gw_vb5/public_html/includes/vb5/template/cache.php on line 171 Notice: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/gw_vb5/public_html/includes/vb5/template/cache.php on line 171 Warning: Undefined array key "crumbs" in /home/gw_vb5/public_html/includes/vb5/template.php(404) : eval()'d code on line 2

          Comment


          • #6
            Please create a Support Ticket for additional help. We will need access to the server, database, and AdminCP.
            Translations provided by Google.

            Wayne Luke
            The Rabid Badger - a vBulletin Cloud demonstration site.
            vBulletin 5 API

            Comment


            • #7
              I have submitted ticket 2352830 with the requested info.

              Comment

              Related Topics

              Collapse

              Working...
              X