Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
C
Core
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 935
    • Issues 935
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • Development
  • Core
  • Issues
  • #2093

Closed
Open
Opened Oct 05, 2020 by DaveD@DaveDDeveloper

Undefined index 'class' on new individual form

It's probably not limited to new individual, but this recent commit added a line that generates the notice:

$fieldAttributes['class'] .= ltrim($fieldAttributes['class'] ?? '' . ' crm-select2');

You can't use .= if the variable isn't set yet, so this gives a red error box on the form. I thought I had written a test to catch generic red boxes on New Individual but maybe it's not a complete test.

Also while it ends up not mattering here, on the right-hand-side personally I think it's best to use brackets to be clear when using ?? and . at the same time, since the . ends up winning and can sometimes be a sneaky bug.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
5.31.0
Milestone
5.31.0
Assign milestone
Time tracking
None
Due date
None
Reference: dev/core#2093