Bug #5551

Notices PHP

Added by tbugier about 1 year ago. Updated 8 months ago.

Status:ClosedStart date:03/05/2018
Priority:LowDue date:
Assignee:yllen% Done:

100%

Category:-
Target version:2.1.0

Description

Hi

With the version 2.0.1 of Behaviours, when I create a ticket I get the following in php-errors.log

I think this will still happen with 2.0.2 as no commt describes this issue since 2.0.1

2018-03-05 11:41:37 [2@workstation] *** PHP Notice(8): Undefined index: solutiontypes_id
Backtrace :
plugins/behaviors/inc/ticket.class.php:440
inc/plugin.class.php:1259 PluginBehaviorsTicket::beforeUpdate()
inc/commondbtm.class.php:1148 Plugin::doHook()
inc/ticket.class.php:2542 CommonDBTM->update()
inc/commonitilactor.class.php:354 Ticket->updateDateMod()
inc/ticket_user.class.php:77 CommonITILActor->post_addItem()
inc/commondbtm.class.php:929 Ticket_User->post_addItem()
inc/commonitilobject.class.php:1472 CommonDBTM->add()
inc/ticket.class.php:2175 CommonITILObject->post_addItem()
inc/commondbtm.class.php:929 Ticket->post_addItem()
front/ticket.form.php:67 CommonDBTM->add()
2018-03-05 11:41:48 [2@workstation] *** PHP Notice(8): Undefined index: solution
Backtrace :
plugins/behaviors/inc/ticket.class.php:446
inc/plugin.class.php:1259 PluginBehaviorsTicket::beforeUpdate()
inc/commondbtm.class.php:1148 Plugin::doHook()
inc/ticket.class.php:2542 CommonDBTM->update()
inc/commonitilactor.class.php:354 Ticket->updateDateMod()
inc/ticket_user.class.php:77 CommonITILActor->post_addItem()
inc/commondbtm.class.php:929 Ticket_User->post_addItem()
inc/commonitilobject.class.php:1472 CommonDBTM->add()
inc/ticket.class.php:2175 CommonITILObject->post_addItem()
inc/commondbtm.class.php:929 Ticket->post_addItem()
front/ticket.form.php:67 CommonDBTM->add()

Associated revisions

Revision 260
Added by yllen 8 months ago

fix solution description and type madatory - fixed #5551

History

#1 Updated by yllen about 1 year ago

I can't reproduce in 2.0.2.
Solutiontype is mandatory in behaviors configuration?
Ticket is created with which status?
Do you use template for create the ticket?

#2 Updated by tbugier about 1 year ago

yllen wrote:

I can't reproduce in 2.0.2.
Solutiontype is mandatory in behaviors configuration?
Ticket is created with which status?
Do you use template for create the ticket?

Hi

I checked how to reproduce.
- I'm in the root entity, and the default ticket template is applied
- I create a ticket by filling ONLY a title and a description => no warning
- I create a ticket by filling title, description and adding a group to requester => warning

I expected to see the warning in both cases, then I'm wondering if the bug is really in Behaviours. (I'm running GLPI 9.2/bugfixes, commit: 013dc2122084b5ff48ef9841d6cf3d6f226892c0)

In Behaviours plugin, solution type is set to "no"

#3 Updated by yllen about 1 year ago

In you template, what is mandatory? what is predefined?

#4 Updated by tbugier about 1 year ago

yllen wrote:

In you template, what is mandatory? what is predefined?

- Description is mandatory (like a fresh GLPI)
- No predefined field
- No hidden field

If you look at the backtrace I provided, it happened on 2018-03-05. This is a development instance of GLPI. I still have the tickets generated when the backtrace occured.

You can see in the history of the template, it was empty when the backtrace was generated, and after reverting the template to its default, I still reproduce.

9179 2018-04-16 10:57 glpi (2) Predefined Field Delete an Item: Predefined Field (Watcher Group (3))
8974 2018-04-03 11:11 glpi (2) Predefined Field Add an item: Predefined Field (Groupe observateur (3))
7677 2018-01-30 16:06 glpi (2) Predefined Field Delete an Item: Predefined Field (Validation (1))
7666 2018-01-30 15:43 glpi (2) Predefined Field Add an item: Predefined Field (Validation (1))

Please, note that I got many plugins in my instance, then if you still don't reproduce, I may test for you with all other plugins disabled and/or with a fresh database. Just ask.

#5 Updated by yllen about 1 year ago

Sorry, i made a test with same parameter and actions like you and i have no PHP notice.

#6 Updated by tbugier about 1 year ago

yllen wrote:

Sorry, i made a test with same parameter and actions like you and i have no PHP notice.

I'll try with a fresh GLPI and only the plugin Behaviors, and feedback.

#7 Updated by yllen 8 months ago

  • Status changed from New to Rejected

#8 Updated by yllen 8 months ago

  • Status changed from Rejected to Assigned

#9 Updated by yllen 8 months ago

  • Assignee set to yllen
  • Target version set to 1271

I understand your problem.
This issue appeaser when you use GLPI 9.3 because solution type and solution description are migrated to another table (not still in tickets table).

#10 Updated by yllen 8 months ago

  • Target version changed from 1271 to 2.1.0

#11 Updated by yllen 8 months ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100

Applied in changeset r260.

#12 Updated by yllen 8 months ago

  • Status changed from Resolved to Closed

Corrected in lastest version: https://forge.glpi-project.org/news/375

Also available in: Atom PDF