#358 - Error when submitting new tickets

Description

What did you do to cause this? Submitting a new ticket

What page were you on? tickets/new

What PHP and MySQL versions do you run? PHP Version 5.3.21 Client API library version 5.5.27

Describe the defect:

Warning: Illegal offset type in isset or empty in /var/www/html/traq/vendor/avalon/database/model.php on line 190

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/traq/vendor/avalon/database/model.php:190) in /var/www/html/traq/vendor/avalon/http/request.php on line 189

Attachments

Activity

  1. Jack commented
    13 years ago

    Besides creating a project, was there anything else that you did?, such as creating or deleting anything?

  2. Nick commented
    13 years ago

    Nope, just creating a new ticket. I've got a custom status and a few components, but they we're all set to 'none'. I also didn't assign the ticket to anyone, the type was defect.

  3. Jack updated this ticket
    13 years ago
    • Milestone 3.2.1 Future

    I did a fresh install and can't seem to reproduce this issue.

  4. Nick commented
    13 years ago

    Okay, I'll let you know if I'm able to reproduce the bug again (so far I've just put @ before the line, which fixed it hacky..)

  5. 13 years ago

    @jack, one of my users can reproduce it. I'm not sure, but just try to perform these steps:

    1. Create a project.
    2. Set permissions so any user from group "Members" could submit a ticket.
    3. Sign up a user. Note: do not set him or her as project member! Just sign up as if it was a new user from anywhere in the world!
    4. Try to submit a ticket and, I think, you'll get this error.
  6. Alexey updated this ticket
    13 years ago
    • Version Future 3.2.1

    the same error. help fix.

  7. Jack commented
    13 years ago

    I've tried as a regular non-project user and still have not reproduced this issue.

  8. 13 years ago

    @jack, hm... I could show you this on my installation. I've temporarily added an @ because my users were really complaining about this but I could remove it for you.

  9. Jack updated this ticket
    13 years ago
    • Severity Normal Major
    • Priority Normal High
    • Status New Investigating
    • Assigned to Jack

    I'm still trying to reproduce this issue, don't worry, when I find something I will update this ticket.

  10. Steve Karolewics commented
    13 years ago

    I'm also seeing this issue, and it happens with every bug I create for a given project (which I created after upgrading from pre-2.4), but not with projects that already existed. Is there any debug spew I can turn on or logs that would help solve this?

  11. Jack commented
    13 years ago

    You could try cloning the Better PHP Errors plugin into the plugins directory and enabling it.

  12. michob commented
    13 years ago

    I just upgraded to 3.2.1 from 3.1.1 and I'm also seeing this error creating tickets in an existing project.

    Here is the output of better_php_errors:

    190	traq/vendor/avalon/database/model.php	if (isset($this->_data[$column])) {
    162	traq/vendor/traq/models/ticket.php	avalon\database\Model->save()
    397	traq/vendor/traq/controllers/tickets.php	traq\models\Ticket->save()
    	[Internal PHP]	traq\controllers\Tickets->action_new()
    78	traq/vendor/avalon/core/kernel.php	call_user_func_array( [ $traq\controllers\Tickets, "action_new" ], [] )
    29	traq/index.php	avalon\core\Kernel::run()
    

    POST:

    type=>"1"
    summary=>"Test"
    description=>"TEST"
    milestone=>"5"
    version=>"0"
    component=>"0"
    severity=>"4"
    priority=>"3"
    status=>"1"
    assigned_to=>"0"
    task_count=>"0"
    tasks=>""
    custom_fields=>[ "0" ]
    

    (snipped! most of the other info contained stuff specific to my server.. if you need it, I'll e-mail privately)

  13. michob commented
    13 years ago

    More info from print_r...

    print_r($this->_data);
    Array ( [severity_id] => 4 
    [priority_id] => 3
     [status_id] => 1 
    [type_id] => 1 
    [extra] => {"voted":[],"custom_fields":{"1":"0"}} 
    [tasks] => []
     [summary] => TEST4
     [body] => TEST4
     [user_id] => 1 
    [project_id] => 1 
    [milestone_id] => 5 
    [version_id] => 0
     [component_id] => 0
     [assigned_to_id] => 0
     [ticket_id] => 280 
    [is_closed] => 0 
    [created_at] => NOW() ) 
    
    
    print_r(static::$_properties);
    Array ( [0] => id 
    [1] => ticket_id 
    [2] => summary 
    [3] => body 
    [4] => user_id 
    [5] => project_id 
    [6] => milestone_id 
    [7] => version_id 
    [8] => component_id 
    [9] => type_id 
    [10] => status_id 
    [11] => priority_id
     [12] => severity_id
     [13] => assigned_to_id
     [14] => is_closed 
    [15] => is_private
    [16] => votes
     [17] => tasks
     [18] => extra 
    [19] => created_at
     [20] => updated_at 
    [21] => TEST4 
    [22] => 1 
    [23] => 5 
    [24] => 0 
    [25] => 4 
    [26] => Array ( ) 
    [27] => 3 ) 
    

    You can see item [26] of print_r(static::$_properties); is an array which is an illegal key for an array. If I add an !is_array($column) to the if statement on 190, I no longer get the error.

    That works for me for now, but it's really just hiding the symptom. I'll let you determine the cause. :)

  14. Jack commented
    13 years ago

    Try this, comment out line 70 of vendor/avalon/database/model.php and let me know how that goes.

  15. michob commented
    13 years ago

    Nope, still getting the error when line 70 of model.php is commented out.

    Could this have to do with the new ticket tasks? Seems those are represented in an array.. Do they need to be serialized?

    If I get more time later, I can try replicating my Traq install into my dev environment so I can plug in a debugger.

  16. michob commented
    13 years ago

    Hmm.. strange. I can't reproduce the error on my local. Same traq install bundle (traq-3.2.1.tar.gz), same database.

    My local has PHP 5.3.10, whereas my host is 5.3.21. Could be something in the PHP versions?

  17. Blake commented
    13 years ago

    I am a new user. I'm getting this error too. I thought I would mention that for me, it only started happening after I created a custom field for my project. The field type was text, minimum length 0, maximum length 40, field title was "Depends". After that, I got this error every time I created a new ticket, even after deleting the custom field.

  18. Blake commented
    13 years ago

    I also have custom statuses, deleted some of the built-in statuses, and renamed some priorities.

  19. 13 years ago

    Hm. @Jack, maybe is it worth to add a new status, for example? I also have some custom statuses like Can't reproduce.

  20. Blake commented
    13 years ago

    Okay, so I reinstalled, except this time I was very careful to create a couple of new tickets every time I changed something, and I was careful to change as few things as possible about the installation: installed software, OK created project, OK deleted built-in status, OK added custom status, OK added milestone to project: then received the above error. The milestone had a name, slug, codename, and description of "admission", with an active status. Blake

  21. Blake commented
    13 years ago

    correction: obviously I did not create a ticket until after I made the project...

  22. Blake updated this ticket
    13 years ago
    • Attached traq error.png

    Okay, I have reproducing this error down to three steps after a new installation and logging in: install software, login: create project, create milestone, new ticket.

    screen shots of all the steps after login are attached to this comment as an image file.

    By the way, I have a programmer background, but PHP is not my main language.

    Blake

  23. Jack updated this ticket
    13 years ago
    • Milestone Future 3.2.2
    • Status Investigating Started

    I've added a hackish fix for this, try the latest version on GitHub and let me know if it works.

  24. Jack closed this ticket as Fixed
    13 years ago

Status

Fixed
Jack
High

Details

Defect
3.2.2
-
3.2.1
Major

Tracking

Nick
13 years and 6 months ago
12 years and 12 months ago
3
-
-