-
-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Entry filter not working with titles containing Ampersands #2446
Comments
Reminds me of #2349. (But in that case escaping with a backslash helped. I don't know what's the solution for ampersands.) |
Ah, got it: Replacing the ampersand by |
Brilliant, sounds good! Thanks Michael. |
Ah, sorry, again we'd only replace the first occurence with that… |
See #2420. We must either split the string or use regex. @nitriques suggested regex last time, but we kept the split in the end. Time to give it another thought. We should make it consistent. Solution 1: input.val(value.split(',').join('\\,'));
input.val(value.split('&').join('%26')); Solution 2: input.val(value.replace(/,/g, '\\,'));
input.val(value.replace(/&/g, '%26')); |
Nah, this is getting a little hacky. We should fully encode the values using encodeURIComponent which will handle all special characters. |
Unfortunately, that doesnt' work, because it will encode The output of encodeURIComponent('test1, test2 & test3'); is |
What a bloody mess. You are correct, we need Perhaps the Q&D method is the best way after all. On Wed, May 20, 2015 at 8:20 PM, michael-e notifications@github.com wrote:
|
Which route? Split or regex replace? (I am by no means an expert in JS.) |
Either or, something like the following should do the trick: value = value.replace(/,/g, '\\,').replace(/&/g, '%26');
input.val(value); |
Ok, did that. Do I have to recompile |
Ah, I just noticed that it's a bit hard to test, because Symphony sends the minified JS file… I have no idea how to recompile the minified file ("correctly"). Last time I hacked into the minified file in order to test the stuff. |
Actually that's a good point, @nilshoerrmann @nitriques are we able to write up a few lines about how to install/recompile the minified assets and add them to the Contributing guide? @animaux It's done using grunt, but I'm not super familiar with the full steps to get grunt installed. I think it's just a |
Once again I hacked the minified file. I replaced |
@brendo those should be the steps. I've set it up to do some modifications before. |
@michael-e I’m not able to find |
No, I am on Symphony 2.6.2. I can find the string. Which editor do you have? |
BBEdit 11.1 |
m( d’oh: hadn’t reloaded the file in the editor after the 2.6.2 update … found it. |
@nitriques might be better at this job :) |
Work’s fine for me! Tested with:
Cheers! |
@brendo @nilshoerrmann I've also added a link to it on the home page. Is it missing something ? |
Pushed the fix for real :) |
The page is completely gone: https://github.com/symphonycms/symphony-2/wiki/Building-the-client-assets-files I know it was there, I saw it. How can that be? |
Re: The fix: Confirmed that it works as advertised. ( @animaux ) |
Sorry, that was me, I thought Github pages did automatic redirects, https://github.com/symphonycms/symphony-2/wiki/Building-Symphony%27s-Assets |
Ah, thanks! |
Oh sorry for the typo! And is the doc ok ? |
Yeah, sure! I just had to do install grunt-cli as well ( |
Totally true. It's not grunt that you need to install globally, it's the cli. I will update the doc accordingly. Thanks |
@michael-e Prima, thanks! :) |
You're welcome. |
Symphony 2.6.1
A similiar problem to this JS-related problem:
When I try to filter a list of entries in in index view by a regular
input field
with a value containing an ampersand, the value reverts to only the word before the ampersand. Here are my steps:input field
titleis
and select a value from the pop-up of existing values f. e. »Bilden & Betten«Probably the ampersand needs to be escaped/encoded at some point and isn’t. Typing »Bilden & Betten« by hand instead of clicking the existing value yields the same result.
The text was updated successfully, but these errors were encountered: