Festival sign-up without a phone field passes null to setAttribute() (PHP 8.1 deprecation)

Open Beginner friendly
#588 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
php
Domain
backend

Research direction

Read system/datatypes/festival.php around line 478 in signupAction() and compare how the same block handles the optional attending field. Confirm that dataFor(self::FIELD_NAME_PHONE) can return null when the configured form omits [[phone]]; done means supplying an empty-string default and confirming the deprecation no longer occurs for that sign-up case.

Written by the indexing model from the issue text.

Description

Impact: Low Level: Easy Pagetype: Festival Type: Bug Value: Coders

Problem. A festival whose sign-up form has no phone field logs a PHP 8.1 deprecation on every sign-up: Passing null to parameter #2 ($value) of type string is deprecated at system/datatypes/festival.php:478 (main d97ab7b), where signupAction() stores $form->dataFor(self::FIELD_NAME_PHONE) without a default. The phone field is optional in a configured sign-up form, so dataFor() returns null.

This is the same kind of fault as #408 (null to setAttribute()), in a place that #408 and its pull request #508 do not cover.

Steps to reproduce (fictional test site, PHP 8.2 and 8.5). Make a festival page, configure a sign-up form without [[phone]], and sign up as a visitor: the container log shows the deprecation.

Proposed fix. $form->dataFor(self::FIELD_NAME_PHONE, ''), as the other optional fields of the same block do with attending.

Found while writing known-bug tests for #520.

🤖 Generated with Claude Code

Dominant language
JavaScript
Stars
5
Forks
9
Avg merge
18h 49m
Merged PRs (30d)
13

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PlanBCode/hypha

All issues in PlanBCode/hypha

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.