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

greggles’s picture

That 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?

MacRonin’s picture

Thanks 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.

greggles’s picture

Title: Is 6 the Max number of XML Keys allowed to input ?? » show all entries for an xml key regardless of the "Number of Ads:" setting
Category: support » feature

This 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.

MacRonin’s picture

Thisa 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.

greggles’s picture

Title: show all entries for an xml key regardless of the "Number of Ads:" setting » increase maxlength on keys to allow for more than 6 keys

right you are!

better title?

pluginstla_chris’s picture

Assigned: Unassigned » pluginstla_chris
Status: Active » Closed (won't fix)

In the current 6.x release you can add any number of XML keys to your system