Lỗi a non well formed numeric value encountered in năm 2024

I try to load data from url using datatable with custom http parameters. origin url like = > localhost/api/data/datatables?start=2019-12-17T09:49:04&end=2019-12-17T10:04:04

table = $('
# datatable').DataTable({
        processing: true,
        serverSide: true,
        ajax: {
            url : '/api/data/datatables',
            data : {
                start : '2019-12-17T09:27:35', 
                end: '2019-12-17T10:27:35'
            }
        },
        autoWidth: false,
        order: [[ 0, "desc" ]],
        columns: [
            { data: 'timestamp', name: 'timestamp'},
            { data: 'data', orderable: false},
        ]
    });
    $.fn.DataTable.ext.errMode = function ( settings, helpPage, message ) { 
        console.log(message);
    };

result :

DataTables warning: table id=datatable - Exception Message:
A non well formed numeric value encountered

how can i fix it?

Now seeing thousands and thousands of notices in the php error logs - just since PHP7 upgrade, I believe...

A non well formed numeric value encountered in /var/www/html/ourweb/html/components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/cbpaidsubscriptions.sysplug.php on line 25

is there a quick fix?

Last edit: 6 years 3 months ago by krileon. Reason: Added [SOLVED] tag to subject

Please Log in to join the conversation.

6 years 3 months ago by krileon

It's a known issue from your own topic below.

Quickfix as follows.

IN: components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/cbpaidsubscriptions.sysplug.php ON: Line 20 - 21 FROM:

$last = strtolower( $memMax{strlen( $memMax ) - 1} ); $memMax = substr( $memMax, 0, -1 );

TO:

$last = strtolower( substr( $memMax, -1 ) ); $memMax = (int) $memMax;

It's however just a notice and won't hurt anything. Folks, don't obsess over a servers error log. It doesn't matter if its filled with billions of notices. They're just notices.


Kyle (Krileon) Community Builder Team Member Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge -- If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results! -- If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible! -- Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you. -- My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

If I compare it with the original OpenCart 2.3.0.2 file, can you tell which code is wrong in the line related to PHP Version 7.3.29?

2.3.0.2-compiled/upload/system/library/pagination.php Original file

Code:

    if ($page > 1) {
      $output .= '<li><a href="' . str_replace(array('&page={page}', '&page={page}'), '', $this->url) . '">' . $this->text_first . '</a></li>';
      if ($page - 1 === 1) {
        $output .= '<li><a href="' . str_replace(array('&page={page}', '&page={page}'), '', $this->url) . '">' . $this->text_prev . '</a></li>';
      } else {
        $output .= '<li><a href="' . str_replace('{page}', $page - 1, $this->url) . '">' . $this->text_prev . '</a></li>';
      }
    }

My file

Code:

    if ($page > 1) {
      $output .= '<li><a href="' . str_replace(array('&page={page}', '&page={page}', '?page={page}'), '', $this->url) . '">' . $this->text_first . '</a></li>';
      if ($page - 1 == 1) {
        $output .= '<li><a href="' . str_replace(array('&page={page}', '&page={page}', '?page={page}'), '', $this->url) . '">' . $this->text_prev . '</a></li>';
      } else {
        $output .= '<li><a href="' . str_replace('{page}', $page - 1, $this->url) . '">' . $this->text_prev . '</a></li>';
      }
    }

Line 38 Original file

My file

Line 41

Code:

        $output .= '<li><a href="' . str_replace('{page}', $page - 1, $this->url) . '">' . $this->text_prev . '</a></li>';

Both the same Line 78

Code:

      $output .= '<li><a href="' . str_replace('{page}', $page + 1, $this->url) . '">' . $this->text_next . '</a></li>';

Both the same

catalog/controller/product/special.php Line 93

Line 256

Code:

    $data['results'] = sprintf($this->language->get('text_pagination'), ($product_total) ? (($page - 1) * $limit) + 1 : 0, ((($page - 1) * $limit) > ($product_total - $limit)) ? $product_total : ((($page - 1) * $limit) + $limit), $product_total, ceil($product_total / $limit));

Line 264

Code:

        $this->document->addLink($this->url->link('product/special', 'page='. ($page - 1), true), 'prev');

All the same catalog/controller/product/category.php Line 174

Line 349

Code:

      $data['results'] = sprintf($this->language->get('text_pagination'), ($product_total) ? (($page - 1) * $limit) + 1 : 0, ((($page - 1) * $limit) > ($product_total - $limit)) ? $product_total : ((($page - 1) * $limit) + $limit), $product_total, ceil($product_total / $limit));

Line 361

Code:

          $this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . '&page='. ($page + 1), true), 'next');

This is the result of my comparison using the original "2.3.0.2-compiled" file, So can you tell me how to solve it?