developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Opened 7 years ago

Closed 7 years ago

#1504 closed bug (fixed)

menulist displays empty item with required=true

Reported by: erp67 Owned by:
Priority: normal Milestone: Jelix 1.3.6
Component: jelix:forms Version: 1.4.2
Severity: normal Keywords: menulist required
Cc: Blocked By:
Blocking: Documentation needed: no
Hosting Provider: Php version:

Description

<menulist> ignores required=true tag when used with <datasource> or getControl()->datasource.

When no default value exists and required is set, it creates a weird <option value selected="selected"> entry.

Patch enclosed to fix this problem.

Attachments (2)

patch (825 bytes) - added by erp67 7 years ago.
Patch to fix the problem.
unified_diff_patch (623 bytes) - added by erp67 7 years ago.

Download all attachments as: .zip

Change History (7)

Changed 7 years ago by erp67

Patch to fix the problem.

comment:1 Changed 7 years ago by laurentj

  • Component changed from jelix to jelix:forms

Sorry. I don't know this format of patch. Please provide a patch with a standard format (like Git or Mercurial generate)

Changed 7 years ago by erp67

comment:2 Changed 7 years ago by erp67

Hello, I use neither git or mercurial, I have attached the patch in a different format (unified diff) which is probably more human readable. To apply it, go in lib/jelix/forms and run command patch < unified_diff_patch

comment:3 Changed 7 years ago by laurentj

We already did this kind of code, but some developers want the empty label displayed : https://github.com/jelix/jelix/commit/14eff2c30c13c1bc6352576a7885338d3a55f3dc

We should have an other strategy..

comment:4 Changed 7 years ago by laurentj

  • Milestone set to Jelix 1.4.3
  • Status changed from new to confirmed

comment:5 Changed 7 years ago by laurentj

  • Milestone changed from Jelix 1.4.3 to Jelix 1.3.6
  • Resolution set to fixed
  • Status changed from confirmed to closed
Note: See TracTickets for help on using tickets.