Since the feature to allow multiple XML keys per site has been added, I have been creating entries for single pages. Up till today this has been going without a problem on the modules end(just mine). Before today I had one site with 6 XML Keys, and it worked fine.
Today I tried to add two more keys and found that I was unable to add them. When I pasted in the text for XML Key #7, I noticed that only the first two characters showed up in the text entry box. The rest of the XML Key was ignored. I browsed the source for the TLA module and found the area where the XML Keys are input but didn't see any explicit string length limit that I might be hitting (The string maxed out at 130). I haven't used the FORM package before myself, Is it possible that there is a default string length that I am hitting with the textfield?
function textlinkads_get_keys() {
$keys = explode(',', variable_get('textlinkads_website_xml_key', ''));
return $keys; $form['textlinkads_website_xml_key'] = array(
'#type' => 'textfield',
'#title' => t('Website XML Keys'),
'#default_value' => variable_get('textlinkads_website_xml_key', ''),
'#description' => t('A comma-separated list of keys (no spaces after commas). You get your XML Site Key from the <a href="http://www.text-link-ads.com/my_account.php?view=my_sites">Get Ad Code page</a> on Text-Link-Ads.com. Each of your site or page within a site has its own code depending on your configuration. It should look something like this: A4WWSAAOULU1XGHWU78G,A4WWSAAOULU1XGHWU78G.'),
);
Comments
Comment #1
gregglesThat sounds right. I think the default length for textfields is 128 (so 130 is weird, but...). http://api.drupal.org/api/file/developer/topics/forms_api_reference.html... says that the default size is 128.
So...we probably just need to set a #maxlength property and make it bigger. Can you test that out and provide a patch?
Comment #2
MacRonin commentedThanks for the confirmation. I'll look at this as an opportunity to learn a bit about the forms API and how to construct a patch [that doesn't use IEBUPDATE ;-), very obscure ref. ] When I finish my part of organizing an event I'm working on, I'll give it a go.
Comment #3
gregglesThis one should be relatively easy - you're "just" removing the query_range to _query and removing some values from the query that limit it.
Also, udpated title and category to fit the ideas as presented.
Comment #4
MacRonin commentedThisa sounds like you are describing my other issue which was about going over a max number of ads for an ad block. This one is about a max number of XML keys allowed to enter and increasing the limit from the current 6. Although they both sound like a good learning experience.
Comment #5
gregglesright you are!
better title?
Comment #6
pluginstla_chris commentedIn the current 6.x release you can add any number of XML keys to your system