Support » Plugin: Memphis Documents Library » FATAL ERROR WP 5.7 PHP 8.0

  • Resolved crgccommsec

    (@crgcrecsec)


    We are multi-year users of MDocs, a great plugin which we have come to significantly rely on. Upon recently upgrading to WordPress 5.7 and php 8.0, we began experiencing a FATAL ERROR. The initial segment of the FATAL ERROR is provided below. Rolling back to php 7.4 resolves the error. We would be happy to provide additional error details privately if this would be helpful. It would be great if you could provide a plugin update that resolves this error.

    ERROR DETAILS – Initial Segment
    An error of type E_ERROR was caused in line 241 of the file /xxxx/xxxx/xxxx/wp-content/plugins/memphis-documents-library/includes/mdocs-show-file-info-templates.php. Error message: Uncaught TypeError: ceil(): Argument #1 ($num) must be of type int|float, string given in /xxxx/xxxx/xxxx/wp-content/plugins/memphis-documents-library/includes/mdocs-show-file-info-templates.php:241

    The Stack trace identifies 9 items.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Try casting the #num variable to float. To do that go to line 241 of mdocs-show-file-info-templates.php file and change $the_rating[‘average’] to (float)$the_rating[‘average’]
    Or you can use floatval($the_rating[‘average’])
    Hope this helps.

    • This reply was modified 4 months, 1 week ago by imarkelis.
    • This reply was modified 4 months, 1 week ago by imarkelis.
    Thread Starter crgccommsec

    (@crgcrecsec)

    imarkelis,

    Thank you! The fix you so kindly offered worked perfectly! I am not php knowledgeable, so the detail you provided is sincerely appreciated!

    Wishing you all the best and thank you again for your help and kindness!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.