Error when submitting new tickets

358
Defect
Nick
Jack
3.2.2
3.2.1
-
Fixed
High
Major
4 years ago
3 years ago
3

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

Ticket History

4 years and 4 months ago by Jack

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

4 years and 4 months ago by Nick

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.

4 years and 4 months ago by Jack

  • Changed Milestone from 3.2.1 to Future

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

4 years and 4 months ago by Nick

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..)

4 years and 3 months ago by Menelion Elensúlë

@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.

4 years and 3 months ago by Alexey

  • Changed Version from Future to 3.2.1

the same error. help fix.

4 years and 3 months ago by Jack

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

4 years and 3 months ago by Menelion Elensúlë

@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.

4 years and 3 months ago by Jack

  • Changed Severity from Normal to Major
  • Changed Priority from Normal to High
  • Changed Status from New to Investigating
  • Assigned ticket to Jack

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

4 years and 3 months ago by Steve Karolewics

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?

4 years and 3 months ago by Jack

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

4 years and 2 months ago by michob

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)

4 years and 2 months ago by michob

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. :)

4 years and 2 months ago by Jack

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

4 years and 2 months ago by michob

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.

4 years and 2 months ago by michob

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?

4 years and 2 months ago by Blake

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.

4 years and 2 months ago by Blake

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

4 years and 2 months ago by Menelion Elensúlë

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

4 years and 2 months ago by Blake

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

4 years and 2 months ago by Blake

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

4 years and 2 months ago by Blake

  • Added attachment 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

4 years and 1 month ago by Jack

  • Changed Milestone from Future to 3.2.2
  • Changed Status from Investigating to Started

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

4 years and 1 month ago by Jack

  • Closed ticket as Fixed