Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Framadate Framadate
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 256
    • Issues 256
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 53
    • Merge requests 53
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • FramasoftFramasoft
  • FramadateFramadate
  • FramadateFramadate
  • Issues
  • #547
Closed
Open
Issue created May 05, 2021 by Lukas Benner@LukasBenner

Undefined offset: 0 in /var/www/framadate/create_date_poll.php on line 143 in 1.1.16

If you want to create a date poll with the first input for date and time empty, it will not display any choices at the next site but the notice to the undefined offset.

2021-05-05_21h23_49

Error is in line 114

$_POST['days'] = array_filter($_POST['days'], function ($d) {
    return !empty($d);
});

Code does not return an array when the first input is empty!!

Results from debugging the case:

Output from development tools:

Before and after the filter with the first input filled:

Response:  Array(3) [ "2021-05-12", "", "" ]
Response:  Array [ "2021-05-12" ]

Before and after the filter with the first input unfilled:

Response:  Array(3) [ "", "2021-05-12", "" ]
Response:  Object { 1: "2021-05-12" }
Edited May 06, 2021 by Lukas Benner
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking