Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Checkbox values 2.03

Quote Reply
Checkbox values 2.03
I use checkbox values in a column

Links which are added by 2.02 looks in this way:
Color: blue, yellow, green, black

Links which are added by 2.03 looks in this way:
Color: #blue, #yellow, #green, #black

I did run build database, nothing changed. Dynamic pages shows the same.

How to get rid of #

Michael


Quote Reply
Re: Checkbox values 2.03 In reply to
Interesting ... I have exactly the same problem on my system with drop down boxes .... except the # shows up after the value eg. blue#, red#, yellow# ..... etc.

I am keen for a solution - it will save me a lot of backspacing when I verify links.


Clint.

--------------------------
http://www.AffiliatesDirectory.com - Affiliate Programs Directory
Quote Reply
Re: Checkbox values 2.03 In reply to
The bug must be at input routine.
The #-sign will be added to the value and stored in the column.

I searched but canīt find the right file to delete "#"

Michael

Quote Reply
Re: Checkbox values 2.03 In reply to
Run this query in your SQL monitor:

UPDATE Links SET Column = REPLACE(Column, CHAR(0), CHAR(35));

where Column is the name of your checkbox field. Also, if you have a prefix make sure to add it on to Links.

We had to change what separates checkbox values, as chr(0) breaks on postgres and ms-sql.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Checkbox values 2.03 In reply to
I get an error with semicolon at the end of the line

UPDATE Links SET Column = REPLACE(Column, CHAR(0), CHAR(35));

Whithout semicolon it runs, but nothing changed.
I have still the # in front of the values.

My column is named 'Hobbies', so my command look like this:

UPDATE Links SET Hobbies = REPLACE(Hobbies, CHAR(0), CHAR(35))

Should this work?
Donīt know about prefix, what does this mean?

Thank you
Michael


Quote Reply
Re: Checkbox values 2.03 In reply to
Hi,

Goto Setup->SQL Server and look to see what is in the Prefix box. If it has something like 'new_', you should change your query to new_Links instead of Links.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Checkbox values 2.03 In reply to
The field 'Table Prefix' is blank. No entrie

Michael

Quote Reply
Re: Checkbox values 2.03 In reply to
Hi,

We changed the input separator from char(0) to char(35) as char(0) would cause problems with other database server.

Basically, we need a character that will separate your checkbox values, what I'm thinking of is using a newline. This means that checkbox/multi-select values won't be able to have newlines.

To fix your issue, you need to write a function:

Hobbies_Formatted => sub { my $tags = shift; my $sep = chr(35); $tags-.{Hobbies} =~ s/$sep/ /g; return $tags->{Hobbies}; }

and then use <%Hobbies_Formatted%> where you want it displayed.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Checkbox values 2.03 In reply to
I use this:

sub {
my $tags = shift;
my $sep = chr(35);
$tags-.{Hobbies} =~ s/$sep/ /g;
return $tags->{Hobbies};
}

and get this error message:

Error: Unable to compile function: Hobbies_Formatted. Reason: syntax error at (eval 6) line 4, near "-." Global symbol "$sep" requires explicit package name at (eval 6) line 4. Global symbol "$tags" requires explicit package name at (eval 6) line 5. syntax error at (eval 6) line 6, near "; }"

Michael

Quote Reply
Re: Checkbox values 2.03 In reply to
Ok, found it out...

sub {
my $tags = shift;
my $sep = chr(35);
$tags-.{Hobbies} =~ s/$sep/ /g;
return $tags->{Hobbies};
}

must be ...

sub {
my $tags = shift;
my $sep = chr(35);
$tags->{Hobbies} =~ s/$sep/ /g;
return $tags->{Hobbies};
}

Michael