Forums

Switch function not working after update

darrenhallinan 04 Mar, 2019
Hi folks

I have just updated both Joomla and Chrono Connectivity (and chrono forms) to the latest version and it seem that the switch function which is looking for a not found event on a read data function no longer works

im using the function to display a no results message when the user uses filters to refine results and no results are returned

this method was working fine until i updated

debug shows data returned but yet the switch function returns "true" and shows the no results view
see attached image for switch function setup
any help or advise appreciated
darrenhallinan 04 Mar, 2019
note: image posted twice so removed this one
darrenhallinan 04 Mar, 2019
Answer
FYI: Changed the expected value from true/false to 1/0 and that fixed it.
healyhatman 05 Mar, 2019
NOTE FOR MAX
It appears that for some reason the Switch and Event Switcher actions work differently here. An event switcher with data source {data.empty:field} will switch on true/false, but a Switch will switch on 1 / 0. Attached form backup to demonstrate.[file=11657]Event_Switch_Testing_05_Mar_2019_03_09_24.cf6bak[/file]
emmexx 18 Mar, 2019
I have problem with the switch function too.
In a brand new joomla I installed CCv6 v. 6.0.10

I created a switch function to display a different icon in a table view based on a field value:

Data provider:
{var/empty:mytable.row.myfield}
Values setup:
false:<i class="sign in teal icon"></i>
true:<i class="sign out brown icon"></i>
In a table view column I put {fn:myswitch} and it works as expected.
If I change false and true to 0 and 1 it doesn't work but it did in previous versions.

I create another switch:
Data provider:
{data:myformfield}
Values setup:
1:foo
2:foofoo
I put {fn:my2ndswitch} in an event Content or in a Form Area Content but it doesn't work.
I tried setting the switch to return the value as var or not to no avail.
That's a big problem, this is going to break a lot of code.

bye
maxx
healyhatman 18 Mar, 2019
Put a {debug:} in, make sure you're actually getting the data you think you are
emmexx 18 Mar, 2019

Put a {debug:} in, make sure you're actually getting the data you think you are


I'm sure, the {debug:} is already there.

The switch has been updated since now you can use regular expressions and *:

Multi line list of possible value and returned result, values can be passed as regular expressions, * matches any value.


In the previous version that same note read as:

Multi line list of possible value and returned result.

healyhatman 18 Mar, 2019
So your switches are not working AT ALL? NOTHING is happening?
emmexx 18 Mar, 2019
So your switches are not working AT ALL? NOTHING is happening?
As I wrote, they're working when used inside a table view.
I tried to use them in an event and in a form area and nothing happens (nothing is displayed when the expected returned value is a string, no view is displayed if the expected matched value is set to display a view.)
In the debug output there's always:
[myswitch] => Array
        (
            [finished] => 1
            [var] => 
        )
healyhatman 18 Mar, 2019
Oh okay if you use
{var/empty:mytable.row.myfield}
when you're not in the table view or in a row isn't going to work.

Your other switch, with {data:myformfield} as the data source, is the myformfield data showing up in the {debug:}?
emmexx 18 Mar, 2019
I setup a form so you can check yourself:
https://secure.sthdev01.soteha.com/traffic/TA/index.php?option=com_chronoconnectivity6&cont=manager&conn=test-switch&event=index

In the index event the code is:
{view:form2}
Here the switch return value: {fn:switch1}{var:switch1}
{debug:}
form2:
Submits to index
Data provider {data:}
Content
{view:field_checkboxes1}
{view:field_button3}
field_checkboxes1:
Name checkboxes1
Options
1=Yes
2=No
switch1:
Data provider {data:checkboxes1}
Return the result as var? is set
Values setup
1:it's a Yes
2:it's a No
I never read it's a Yes or it's a No after Here the switch return value:
healyhatman 18 Mar, 2019
Can you PM me login details so I can take a look?
healyhatman 18 Mar, 2019
VERFIFIED: User didn't have CF installed and the switch function simply wasn't working. Installed CF and now it's working, but user should've have had to.
emmexx 18 Mar, 2019

...but user should've have had to.


And developers or sellers should have had to write in big letters in the download page of CCv6 that all its features work only if CFv6 in installed too!
Max_admin 19 Mar, 2019
2 Likes
Hi,

The issue is that the switch function had a glitch which was fixed in the latest CF release but CC did not get the same fix yet, installing CF had updated the shared lib files and fixed the problem.

Best regards
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
GreyHead 19 Mar, 2019
1 Likes
Hi,

For a bit more explanation . . . both components use the CEGCore2 library and it is installed with either component. Unfortunately the library is sometimes updated in a new CF release but a new CC release is not made at the same time so the two get out of sync. You can always update the CC library by installing the latest CF release (and then uninstalling it if you don't need it). Not ideal but it works.

Bob
emmexx 19 Mar, 2019

The issue is that the switch function had a glitch which was fixed in
the latest CF release but CC did not get the same fix yet, installing CF
had updated the shared lib files and fixed the problem.


Ok, thank you Max for the clarification.
So, generally speaking, I don't need to install both CF and CC if I only need CC.

maxx
This topic is locked and no more replies can be posted.