Apostrophe problem in multiple-select fields - drupal

I have been fruitlessly searching for a solution for the following problem in Drupal.
Making a selection in a multiple-select field (i.e. a list of checkboxes) will yield an "Illegal Choice Detected" error if any of the choices contain apostrophes. This problem is referenced here. This field exists within registration and is not generated through either webforms or CCK.
Does anyone have any exact solution in mind, i.e. specific code to add to modules, or making particular updates?

Try to use one of two php functions to generate strings:
htmlspecialchars
htmlentities

Related

Dynamic Receiver in Powermail (6.0.0) based on String

TYPO3 8.7.x, Powermail 6.0.0
I'd like to override the receiver based on two subjects they can select.
Now I know that this works just fine:
[globalString = GP:tx_powermail_pi1|field|konsilbereich = 5]
But this does not seem to work:
[globalString = GP:tx_powermail_pi1|field|konsilbereich = "Some phrase"]
I read that some workarounds were to have a hidden field that's been filled by Javascript upon a users selection and instead of the actual field, the hidden field gets submitted. But that is not an option for us.
I checked the docs as well as many support forums but could not find a good answer to this.
Is this not possible, or if, how would I accomplish that I can use an actual string within the comparison?
The problem is a comparisation with a string in TypoScript conditions. Strings could have space, special characters or umlauts. That's why TypoScript works best with integers.
Two possibilities come into my mind for your case:
1) Building an own conditition is quite simple in TYPO3 (see https://docs.typo3.org/typo3cms/TyposcriptReference/latest/Conditions/Reference.html#custom-conditions for an easy example)
2) Use an integer together with GP: - but then I would use a selectbox with a text as label and a number as value

Robot framework: How to locate a lone input text field using Xpath

I am a newbie but keen into test automation. Please don't hesitate to send and reply ANY hints you have.
So the problem is that I've faced a web page where there is input field but there is no ID for it in source. Input field has type=text AND that input field is THE ONLY on that page. I have not been able to locate that element with Robot Framework (+PyCharm) but I have a feeling that it should be possible some way in Xpath? Please help me.
Using Input Text xpath=//INPUT[#type='text'] test -> gives this error:
"InvalidElementStateException: Message: invalid element state:
Element is not currently interactable and may not be manipulated"
I am afraid that the ancient framework used in system under test is the problem. It's called GWT-ext and in many cases there exists id for element but it's generated randomly every time so that cannot be used as locator of the element. That's why I need to use other ways, like field names, types etc.

Google analytics error message 'Unexpected error. please try again later'

When trying to save a filter to a GA dashboard widget I am getting the error message 'Unexpected error. please try again later'.
The widget I am having a problem with is the 'show landing pages for Facebook referrals' widget.
Here are the parameters I set...
Display the following columns:
Page title
Unique pageviews
Filter this data:
Only show 'Social source referral' Exactly matching Yes
Only show 'Social network' Exactly matching Facebook
Up to this point I can save the widget.
Now...its the following filter that is causing the problem.
Only show 'Page' Regular expression
twwdcqgfk1|u0evfggft91b|u0qpgfgfgy64z|u2lfgfgfhrnsg1|u4d5aerwwrhoz|u6mwwwrr39tiz|u8tr5hfs2st5z
The above is only a sample of the ids, I use about 450 ids in the regular expression field.
When I use this filter on other widgets in the same dashboard and in widgets of other dashboards it works fine but on a few I get the error when trying to save 'Unexpected error. please try again later'.
If I just use two ids in the regular expression field i.e. u4d5aerwwrhoz|u6mwwwrr39tiz I can save the widget with the 'page' filter - however if I add more than two ids that's I cannot save.
I can't figure it out, i've tried saving this filter using multiple browsers, on different pc's, at different times but I cant get it to work.
Any ideas?
Thanks
the reason why the report won't work is quite simple :-)
Regular Expressions — You can also use regular expressions in filter
expressions using the =~ and !~ operators. Their syntax is similar to
Perl regular expressions and have these additional rules: Maximum
length of 128 characters — Regular expressions longer than 128
characters result in a 400 Bad Request status code returned from the
server.
The workaround from my experience is to use API and run several queries so that you can stay within the limits. But it's pain in the ass...
If there is some simpler pattern -- I checked and all of the posted IDs have 13 characters, so maybe you could use regular expression checking the number of characters. Something like:
.*\?^facebookAdId=.{13}$/
The curly brackets are the way to check the number of occurrences. This could probably help.

Encoding wildcarding, stemming, etc in simple search

We have a simple search interface which calls the search:search($query-text) function. Is there a syntax to include control for wildcarding, stemming and case sensitivity within the single text string that the function accepts? I haven't been able to find anything in the MarkLogic docs.
See the $options parameter and the <term> and <term-option> constraint at https://docs.marklogic.com/search:search . There is a guide at http://developer.marklogic.com/learn/2009-07-search-api-walkthrough
and some details http://developer.marklogic.com/learn/2009-07-search-api-walkthrough#ndbba3437f320a4a4
I don't know of any existing syntax for those options, aside from the built-in behavior of turning on wildcards when a term contains '*' or '?' and turning on case-sensitivity when the term contains capital letters.
You could develop a syntax. Implementing it might involve a custom parser along the lines of https://github.com/mblakele/xqysp then feeding the resulting cts:query into search:resolve.
Piggybacking on Eric Bloch's answer... you can always dynamically construct your node based on input in the user interface.
For example, I often do this in order to separate the facet selection portion of the query from the text search portion and put the facet selection query in the additional-query element in the options node.

jQuery autocomplete in ASP.NET webforms?

Has anyone used jQuery to populate an autocomplete list on a textbox using ASP.NET webforms? If so, can anyone recommend a good method? From my reading so far, it seems like most people are using delimited lists rather than JSON to bring the items back. I'm open to any ideas that will get me up and running rather quickly.
I made a tutorial to do this with asp.net mvc but it should be almost identical for traditional webforms:
http://blogs.msdn.com/joecar/archive/2009/01/08/autocomplete-with-asp-net-mvc-and-jquery.aspx
There are many, many examples on the web. I've used this one before, and if I recall you only need to create an aspx that will return matching terms as a <BR/> separated list:
http://www.dyve.net/jquery/?autocomplete
The documentation shows php in the example, but there's no difference in the way the plugin itself works and I didn't have to do anything special as a result.
From the documentation:
> $("#input_box").autocomplete("my_autocomplete_backend.php");
In the above example, Autocomplete
expects an input element with the id
"input_box" to exist. When a user
starts typing in the input box, the
autocompleter will request
my_autocomplete_backend.php with a GET
parameter named q that contains the
current value of the input box. Let's
assume that the user has typed
"foo"(without quotes). Autocomplete
will then request
my_autocomplete_backend.php?q=foo.
The backend should output possible
values for the autocompleter, each on
a single line. Output cannot contain
the pipe symbol "|", since that is
considered a separator (more on that
later).
An appropiate simple output would be:
foo
fool
foot
footloose
foo fighters
food fight
I wrote an Asp.Net WebControl and some Asp.Net MVC extension methods wrapping the JQuery UI autocomplete widget.
I wrote documentation as well about how to implement a working resource providing a JSon result.
You can find it at:
http://autocompletedotnet.codeplex.com/
Hope it can help

Resources