• Resolved KTS915

    (@kts915)


    Just come across this. It looks beautifully simple, and I’d really like to use it. I have found a few problems, though. To avoid confusion, I’ll report each one a separate thread.

    The first is that, on PHP 7.1 (though I think it will be the case for PHP 7.0.14 and above), when going to the Add New Invoice or Add New Estimate screen, I get this:

    
    Fatal error: Uncaught Error: [] operator not supported for strings in ~/wp-content/plugins/littlebot-invoices/views/html-admin-invoice-line-items.php:12 Stack trace: #0 ~/wp-content/plugins/littlebot-invoices/includes/class-lbi-post-line-items.php(62): require_once() #1 ~/wp-admin/includes/template.php(1048): LBI_Line_Items->render_line_items(Object(WP_Post), Array) #2 ~/wp-admin/edit-form-advanced.php(703): do_meta_boxes(Object(WP_Screen), 'normal', Object(WP_Post)) #3 ~/wp-admin/post-new.php(85): include('/var/www/html/n...') #4 {main} thrown in ~/wp-content/plugins/littlebot-invoices/views/html-admin-invoice-line-items.php on line 12
    

    This seems to be resolved by just making the following change to the file html-admin-invoice-line-items.php. Add $line_items = array(); to line 3. Then I think you can also delete the following code that currently appears just below:

    	
    if ( !is_array( $line_items ) ) {
    		$item = array();
    		$item['item_title'] = '';
    		$item['item_desc'] = '';
    		$item['item_qty'] = '';
    		$item['item_rate'] = '';
    		$item['item_percent'] = '';
    		$item['item_amount'] = '';
    		$line_items[] = $item;
    	}
    
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Fatal Error on PHP 7.1’ is closed to new replies.