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

Opened 13 years ago

Last modified 7 years ago

#648 confirmed bug

class dao factory , bug when generating parameter with default value

Reported by: samtahRam Owned by: samtahRam
Priority: normal Milestone:
Component: jelix:dao Version: 1.0.4
Severity: major Keywords:
Cc: Blocked By:
Blocking: Documentation needed: no
Hosting Provider: Php version:


i want to attract your attention about a bug when we declare a method in the xml file of which parameters are initialized with default values. indeed, after the generating process, the parameters type are systematically in string, the others types like boolean aren't set at all. For instances, in our xml

<method type="php" name="test">

<parameter name="a" default="null" /> <parameter name="b" default="false" /> <body><![CDATA[ ]]></body>


the method that we obtain is something like this

public function test ($a='null',$b='false'){


Change History (8)

comment:1 Changed 52 years ago by laurentj

  • Milestone changed from Jelix 1.6.0 to Jelix 1.6.1pre

comment:1 Changed 13 years ago by laurentj

  • Priority changed from high to normal
  • Type changed from bug to enhancement

This is not a bug. It generates string because there is no way here to know the type of the default value. jDao cannot guess if you mean "null" or null.

We could support other attributes for specific type of values...

comment:2 Changed 10 years ago by laurentj

  • Status changed from new to confirmed
  • Type changed from enhancement to bug

comment:3 Changed 10 years ago by foxmask

Laurentj ; how do you prefer we handle this :

with a list of known types like true/false/null specially when the method is "php" ?

comment:4 Changed 10 years ago by laurentj

I suggest

<parameter name="a" default="null" type="null"/>

or "boolean", "integer", "float" ...

comment:5 Changed 9 years ago by laurentj

  • Milestone set to Jelix 1.5

comment:6 Changed 9 years ago by laurentj

  • Milestone changed from Jelix 1.5 to Jelix 1.6

comment:7 Changed 7 years ago by laurentj

  • Milestone Jelix 1.6.1pre deleted

Milestone Jelix 1.6.1pre deleted

Note: See TracTickets for help on using tickets.