Skip to content

GLPI 11: task descriptions with line breaks break the Planning page #19

Description

@PedroDpemt

Environment

  • GLPI: 11.0.8
  • Task'n'Drop: 3.0.0
  • Browser: Google Chrome
  • Language: Portuguese (Brazil)

Problem

When an unplanned ticket task or change task contains real line breaks in its description, the Task'n'Drop panel is not displayed on the GLPI Planning page.

The Planning calendar loads, but the sections Plan this task and Planning reminder do not appear.

The browser console shows this error:

Uncaught SyntaxError: Failed to execute 'appendChild' on 'Node': Invalid or unexpected token

Steps to reproduce

  1. Create a ticket task or change task.
  2. Assign it to a user or group.
  3. Leave the task pending and unplanned.
  4. Add a multiline description using paragraphs or real line breaks.
  5. Open Assistance > Planning.
  6. Select the assigned user or group.

Actual result

The Task'n'Drop panel is not rendered.

The generated JavaScript contains the task description directly inside a quoted string, similar to this:

$('#planning_filter_content').append("<div>First line
Second line
Third line</div>");

The real line breaks invalidate the JavaScript string.

A single unplanned task with this type of description can prevent the panel from loading for all users or groups whose Planning view includes that task.

Expected result

The plugin should safely handle:

  • line breaks;
  • paragraphs;
  • quotes;
  • emojis;
  • HTML generated by the GLPI rich-text editor;
  • long task descriptions.

The Planning page should load regardless of the task description content.

Additional usability issue

GLPI tasks do not have a separate title field. Task'n'Drop therefore displays the complete task description as the card label.

Long descriptions create excessively large cards and make the Planning sidebar difficult to use.

A better behavior would be to:

  • normalize spaces and line breaks;
  • display only the first 100 to 150 characters;
  • add an ellipsis;
  • optionally show the complete description in a tooltip.

Confirmed workaround

Editing or closing the task containing real line breaks makes Task'n'Drop load again.

Descriptions stored on a single physical HTML line and using <br> tags do not reproduce the error.

Impact

This issue can prevent the entire Task'n'Drop panel from loading because of the content of a single unplanned task.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions