MySQL Field Type Plugin

4 years 9 months ago #240291 by razzo
Little problem with J3.x


I solve changing the line 95 in cb.mysqlfield.php in this way:
//$_CB_database->setQuery(str_replace("{USERID}", $user->id, str_replace("{VIEWERID}", $viewer->id, $query)));
		    if ($viewer->id != null) {
		    	$query = str_replace("{VIEWERID}", $viewer->id, $query);
		    } else {
		    	$query = str_replace("{VIEWERID}", "0", $query);
		    }
		    if ($user->id != null) {
		    	$query = str_replace("{USERID}", $user->id, $query);
		    } else {
		    	$query = str_replace("{USERID}", "0", $query);
		    }
		    $_CB_database->setQuery($query);
The following user(s) said Thank You: cardoso69
4 years 9 months ago #240296 by pepperstreet

razzo wrote: Little problem with J3.x
...


Would you mind to tell us the actual problem in more detail, please? What was the issue in what situation. Thanks in advance.
4 years 6 months ago #244677 by FilMarX
Very nice plugin.

The only problem I have, it shows only the values when you view the profile.
When you want to edit the profile, you don't see the values any more.

Is there a way to overcome that?

Many thanks in advance,
3 years 10 months ago #256102 by cardoso69
I think I've found what razzo wants to say.
When we try to use the plugin in the new J!3.0 version and with the CB 2.0/2.3, and if we want to create some CB Lists, the the following error is displayed, when i use this query:

"1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 SQL=SELECT CONCAT (lastname, ', ', firstname) AS mysqlfield FROM c629i_comprofiler WHERE id = {USERID}"

In my case, after some debugging i found that the problem comes when we use the variable {USERID}, so after I've changed the code in line 59 (not in line 95 as razzo said, maybe a mistyping) the list is working again.

It looks like the plugin need some changes to be fully compatible with CB 2.0 and J!3.
3 years 6 months ago #263932 by gtrennert
I have a little problem with the plugin :
My users have to make inscription : they give their birthday (required) and some mysql fields should store some values depending of the birthday in some cb custom fields
After inscription the user gets a mail to validate the inscription and when he did this the administrator will approve.
Once approved I hoped that the mysql fields have calculated the values but this is not the case - the user must go edit his profil and once saved the right values are calculated.
Can anyone tell me if there is a way to make the calculation work at latest when approoving the user ?

Thanks :)
3 years 5 months ago #264385 by gtrennert
To be more clear what happens :
After approving if any user goes to the profile of the new user for the first time the custom fields are not calculated - then if he reloads (F5) then the custom fields are finally calculated.
Why is that that the same page the first time does not work in the same way as the second time !!!???
I have to look for a solution - perhaps by adding some php.
Any hint would be welcome !
Moderators: beatnantkrileon
Time to create page: 0.400 seconds
Facebook Twitter Google LinkedIn