[phpldapadmin] [ phpldapadmin-Bugs-3294924 ] Template Selects dosen't work properly
"SourceForge.net" <[email protected]> Sat, 30 Apr 2011 03:01:53 +0000
| Newsgroups | gmane.comp.ldap.davedap |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #3294924, was opened at 2011-04-29 23:50
Message generated for change (Comment added) made by wurley
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=498546&aid=3294924&group_id=61828
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Pending
Resolution: None
Priority: 5
Private: No
Submitted By: Stefan Klatt (stefanklatt)
Assigned to: Nobody/Anonymous (nobody)
Summary: Template Selects dosen't work properly
Initial Comment:
phpLDAPadmin 1.2.0.5, openldap 2.4.25, php 5.3.3, apache 2.2.15, openSuse 11.3
Hi,
I use selects for boolean and string attributes.
First for boolean attributes (EXFilterOut):
<attribute id="EXFilterOut">
<value>true</value>
<value>false</value>
</attribute>
Gives "true, false, true, false" with default "true" to select.
<attribute id="EXFilterOut">
<display>Ausgehende Email</display>
</attribute>
Gives "true, false" with a empty default to select.
<attribute id="EXFilterOut">
<display>Ausgehende Email</display>
<default>true</default>
</attribute>
Gives "true, false, true" with default true to select.
<attribute id="EXFilterOut">
<type>select</type>
<value>true</value>
<value>false</value>
</attribute>
I get "true, false" with default "true" to select.
<attribute id="EXFilterOut">
<type>select</type>
<value>true</value>
<value>false</value>
<default>false</default>
</attribute>
I get "true, false" with default "true" to select.
Second with strings (EXFilterType) the following happens:
<attribute id="EXFilterTyp">
<value>Subject</value>
<value>Subject-begins</value>
<value>Subject-fix</value>
<value>Subject-ends</value>
</attribute>
I get four text fields, each filled with one of the values. And an error if at saving this template (that's correct, four text fields instead one!)
<attribute id="EXFilterTyp">
<type>select</type>
<value>Subject</value>
<value>Subject-begins</value>
<value>Subject-fix</value>
<value>Subject-ends</value>
<default>Subject-begins</default>
</attribute>
Gives al values to select and "Subject" as default.
<attribute id="EXFilterTyp">
<type>select</type>
<value>Subject</value>
<value>Subject-begins</value>
<value>Subject-fix</value>
<value>Subject-ends</value>
</attribute>
Gives al values to select and "Subject" as default.
I think there are a few logical failures. phpLDAPadmin 1.0.0.2 handle all correct without using HTML type "select".
With 1.2.0.5 it works only "correct" if I use HTML type "select", but Defaults are ignored.
Stefan
----------------------------------------------------------------------
>Comment By: Deon George (wurley)
Date: 2011-04-30 13:01
Message:
Sounds like your patch is not applied. The --stat argument to git apply
does not apply the patch.
git status should confirm the patch is applied.
If it is infact applied, give me a copy of your schema and your template.
----------------------------------------------------------------------
Comment By: Stefan Klatt (stefanklatt)
Date: 2011-04-30 12:53
Message:
The patch is applied already :-) :
git apply --stat sfbug-3294924.patch
lib/Attribute.php | 17 +++++++++++++++--
lib/PageRender.php | 5 +----
lib/SelectionAttribute.php | 7 +++++++
3 files changed, 23 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
Comment By: Stefan Klatt (stefanklatt)
Date: 2011-04-30 12:48
Message:
If I use
<default>TRUE</default>
it works.
If I use
<default>true</default>
I get "true","false","true" to select.
The string problem:
Without HTML type select I get 4 strings with the values.
With HTML type select I get a select box with the values, but as result
the number of the value I selected.
But I need the value I selected.
I upload two snapshots to visualize it.
Here the used attribute definition, multi value pla use without HTML type
select isn't correct I think:
attributetype ( 1.3.6.1.4.1.25926.1.1.39
name 'EXFilterTyp'
desc 'EXFilter Typ - Subject, From, To, FromTo, Subject, Msgbody'
EQUALITY caseIgnoreMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{200} )
Stefan
----------------------------------------------------------------------
Comment By: Deon George (wurley)
Date: 2011-04-30 12:24
Message:
You can use lowercase in your <default> declaration as well, for boolean
attributes. (It shouldnt affect what is rendered by the template engine,
nor should it affect what is selected by default.)
I dont understand your string issue - it works for me with the supplied
patch.
----------------------------------------------------------------------
Comment By: Stefan Klatt (stefanklatt)
Date: 2011-04-30 11:49
Message:
This works now if I use
<default>TRUE</default>
with no values.
Why you use here upper case and for displaying lower case? If you use
everywhere lower (the same) case it's easier for new user.
What about the select of strings? At the moment i get only the number of
the string (0 for the first, 1 fot the second,.... ) not the string itself.
----------------------------------------------------------------------
Comment By: Deon George (wurley)
Date: 2011-04-30 09:46
Message:
As I said earlier, for boolean attributes (as defined by the schema), you
do not need to add <value> tags - they are generated automatically. You can
add a <default> taken to choose a default of TRUE/FALSE.
The supplied patch is not yet commited to git - i'm waiting for feedback
from you in case I need to do modifications... But it does apply against
1.2.1
----------------------------------------------------------------------
Comment By: Stefan Klatt (stefanklatt)
Date: 2011-04-30 06:54
Message:
Hi,
* For boolean attributes (as defined by the schema), you dont need to add
* TRUE/FALSE, they are added automatically.
I need the default value, even for a boolean attribute. And without values
i can't use defaults.
I think i will download a actual snapshot with the last patches.
Stefan
----------------------------------------------------------------------
Comment By: Deon George (wurley)
Date: 2011-04-30 02:09
Message:
OK, a couple points:
* For boolean attributes (as defined by the schema), you dont need to add
TRUE/FALSE, they are added automatically. The value is TRUE uppercase, the
"text" is true lowercase (or as translated by your language).
* If you have multiple values and you DONT have <type>select</type>, then
it will render as a multivalue attribute (if the schema defines it as one)
I've have attached a patch that should fix the select lists (the values
were incorrect, even though the rendered display was). Let me know if this
patch fixes your problem. (This patch is against 1.2.1, so it may not apply
cleanly to 1.2.0.5.)
----------------------------------------------------------------------
Comment By: Stefan Klatt (stefanklatt)
Date: 2011-04-30 01:03
Message:
The selected value will be converted to "0".
----------------------------------------------------------------------
Comment By: Stefan Klatt (stefanklatt)
Date: 2011-04-30 01:03
Message:
If i use the following:
<type>select</type>
<value>Subject</value>
<value>Subject-begins</value>
<value>Subject-fix</value>
<value>Subject-ends</value>
it will be converted to "0" !
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=498546&aid=3294924&group_id=61828
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network
management toolset available today. Delivers lowest initial
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
______________________________________
phpLDAPadmin development mailing list.
To unsbuscribe: https://lists.sourceforge.net/lists/listinfo/phpldapadmin-devel
http://phpldapadmin.sourceforge.net/