German characters in a form PHP plugin onAfterProcess not updated correctly

katarzynal

New Member
I seem to face a hopefully minor problem. I'm working on my site in German (backend, frontend, everything). I'm using a link element to set a link to a form of another list that would prefill a field based on given link (using method GET).

Something like:
id | product
17 | chair
link ending with: /7?produkt=17

I am checking later on whether the given number is really a number and not e.g. a script or something.

The problem is that when I was using it onBeforeProcess, it pasted the data I wanted the way I wanted to the database and then displayed it correctly on the site.
Then I've decided to switch to onAfterProcess because I didn't want to get to information_schema database (I needed the ID of the row that is not set at onBeforeProcess yet and I've read it is not the best way to access future ID).
The problem is, when I'm trying to update exactly the same value to the table (in a form like
PHP:
$id = (int) '{table___id}';
$bestellung = "{\"label\":\"Bestellung hinzuf?gen\",\"link\":\"http://my-site.de/...request=" . $id . "\"}";
$query = "UPDATE table SET bestellung = '$bestellung' WHERE id = $id";
mysqli_query($con, $query);
), the link is being added but German ? is changed into ü:

Code:
| 68 | {"label":"Bestellung hinzuf?gen","link":"http:\/\/[my_site]\/index.php\/form\/5?request=68"}                         |
| 81 | {"label":"Bestellung hinzufügen","link":"http://[my_site]/index.php/form/5?request=81"}                             |
| 82 | {"label":"Bestellung hinzufuegen","link":"http://bwmk-kleinanzeigen/index.php/form/5?request=82"}                    |
Where row 68 is added onBeforeProcess, row 81 onAfterProcess, row 82 onAfterProcess with ue instead of ?.

I've inserted the string with those backslashes too, I've noticed this is the way Fabrik stores its links in database when they're created manually when submitting a form.

I've got the same problem when I need to update product name, where I cannot just write another letter in the code (but it is a normal field).

I've checked my charset and collation of the table and database and it's utf8 and utf8_general_ci which shouldn't be the problem (as I mentioned, it worked just fine onBeforeProcess).

Any idea how to get around it (specially for the product name case, where I'm accessing another table) and insert the characters unchanged instead of writing a custom function to replace them?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top