"Fatal error" when trying to edit an Invoice

enzipher - November 1, 2009 - 20:18
Project:Storm
Version:6.x-1.x-dev
Component:Storm Invoice
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hi,

I just upgraded from 1.25 to 1.26, and when trying to edit an invoice I get the following error:

Fatal error: Cannot use string offset as an array in C:\www\storm\includes\form.inc on line 984

I have located the problem to this code block (.module line 445):

<?php
  $count
= count($node->items);
  for (
$k = $count; $k <= $count + 2; $k++) {
   
//$node->items[$k] = stdclass;
   
$node->items[$k]->tax1app = variable_get('storm_tax1_app', 1);
   
$node->items[$k]->tax1percent = variable_get('storm_tax1_percent', 20);
   
$node->items[$k]->tax2app = variable_get('storm_tax2_app', 0);
   
$node->items[$k]->tax2percent = variable_get('storm_tax2_percent', 20);
   
$node->items[$k]->new_item = TRUE;
  }
?>

Note: The .module file is unchanged from 1.26.

Please review this. Thanks!

PS. Thanks for the great job maintaining this project.

#1

Magnity - November 2, 2009 - 09:19

I thought this had been solved by #617624: Problem with Storm Invoices Nodes After Upgrade to 6.x-1.25 and the new release of 1.26...

Could I double check that you are on 6.x-1.26?

However - will look into it.

#2

Roberto Gerola - November 2, 2009 - 17:33
Assigned to:Anonymous» Roberto Gerola

I think the problem is related to second tax field.
I have disabled it in the settings page and got the same error.

Not yet tested with the dev version.
I'll test it tonight and work on a fix.

Roberto

#3

Mores - November 3, 2009 - 19:46
Assigned to:Roberto Gerola» Anonymous

Hi,

I have the same error when I want to make a new invoice:

Fatal error: Cannot use string offset as an array in C:\...\includes\form.inc on line 984

I'm using Drupal 6.14 and Storm-6.x-1.26.

#4

Magnity - November 6, 2009 - 00:36
Status:active» fixed

Fixed - yes, an issue with the code that hides the tax2 fields when not in use (and in fact, tax1 fields also when not in use).

I'd be grateful if a few people could test the latest -dev when it rolls to ensure this issue is fixed for all!

AttachmentSize
storminvoice.module.patch 922 bytes

#5

squ1rr3l - November 6, 2009 - 02:27

I'll be testing. I use invoices a lot.

#6

enzipher - November 6, 2009 - 05:24
Status:fixed» needs work

I can confirm that the patch made the error message go away, but it seems the "amount" value is no longer saved with the invoice. Can someone confirm this?

#7

Magnity - November 6, 2009 - 10:02

By "amount" do you mean the invoice ITEM amount or invoice TOTAL amount?

If item, then the patch in #617624-7: Problem with Storm Invoices Nodes After Upgrade to 6.x-1.25 should help you?

#8

enzipher - November 6, 2009 - 22:53

I mean the invoice Amount. This is perhaps by design. I'll try to explain. For invoice Items the amounts adds up and is show in the "Amount" and "Total" fields, but each items amount is not visible in the item list.

When not using any of the Items fields and just fill in the Amount and/or Total, the "Amount" value is not saved (or calculated to 0) and shows as "0" on the node view page, not even the "Total" value shows up which actually is saved.

EDIT:
Ok, was a little to fast. I checked the patch, and it fixes the fact that the amount is not shown in the item list, the issue that remains is that when just filling in the "Total" value (using no Items), it is not shown on the node view page under "Total". Also the (total) "Amount" value is calculated to 0, but I am guessing that is as it should be.

I am also a little confused over the "Total in customer currency" value. It's seems completely separated from anything else and is not shown anywhere as I can see.

#9

Magnity - November 7, 2009 - 16:52
Status:needs work» fixed

OK. In that case I think we should close this issue as fixed and have a discussion about these things in other issues:

The expected use case is that people will enter items and the total will set itself to the sum of the items. I'm happy to discuss this in a new issue though if it is something that doesn't ring true with your processes.

This issue is the best one to comment about the customer currency field: #518664: Review Storm's handling of currencies

#10

System Message - November 21, 2009 - 17:00
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.