Here is the problem (third and fourth field labelled "Wykonawca" and "Gatunek muzyki"): http://www.dobranutka.pl/?q=node/add/nutka
As you can see i have 2 fields with taxonomy, with default autocomplete (Maybe there is some config to autocomplete?) When i write something in those, i have an error:

An error occurred. 
http://www.dobranutka.pl/?q=taxonomy/autocomplete/1
{ "Motorhead": "Motorhead" }

<!-- www.000webhost.com Analytics Code -->

<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>

<noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript>

<!-- End Of Analytics Code -->

I think it can be because of some rewrite rule, which 000webhost add to the end of each file.
When i go to taxonomy/autocomplete there is an appended code:

[  ]
<!-- www.000webhost.com Analytics Code -->
<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>
<noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript>
<!-- End Of Analytics Code -->

I have been testing on localhost and in that environment there is only strange "[ ]" under taxonomy/autocomplete, whatever means that "[ ]". So maybe this is because of that provider, earlier I haven't got problems with autocomplete, but how to fix that?

I would like to mantion, that i saw similar issue
http://drupal.org/node/434150
and pasted that code into mine, but it didn't help.

Any help would be appreciated. Thanks in advance :)

Comments

nheim’s picture

hello,

same problem here, and same webhost.

i fixed it by adding a filter function to the jQuery ajax call in both misc/autocomplete.js and misc/progress.js (end of the files) i added :

      dataFilter: function (data, type) {
            cG = new RegExp(".*(\{.*\}).*").exec(data);
            return (cG&&cG[0])?cG[0]:'[]';
      },

to filter json parameters

it gives :

/**
 * Request progress data from server.
 */
Drupal.progressBar.prototype.sendPing = function () {
  if (this.timer) {
    clearTimeout(this.timer);
  }
  if (this.uri) {
    var pb = this;
    // When doing a post request, you need non-null data. Otherwise a
    // HTTP 411 or HTTP 406 (with Apache mod_security) error may result.
    $.ajax({
      type: this.method,
      url: this.uri,
      data: '',
      dataType: 'json',
     //----- code added here
      dataFilter: function (data, type) {
            cG = new RegExp(".*(\{.*\}).*").exec(data);
            return (cG&&cG[0])?cG[0]:'[]';
      },
     //-----
      success: function (progress) {
        // Display errors
        if (progress.status == 0) {
          pb.displayError(progress.data);
          return;
        }
        // Update display
        pb.setProgress(progress.percentage, progress.message);
        // Schedule next timer
        pb.timer = setTimeout(function() { pb.sendPing(); }, pb.delay);
      },
      error: function (xmlhttp) {
        pb.displayError(Drupal.ahahError(xmlhttp, pb.uri));
      }
    });
  }
};

for the progress.js call, i added same thing for autocompete.js

it work for me, hope it will help some others.

insercoop.org’s picture

Version: 6.15 » 6.16
Issue tags: +content taxonomy

Hi,
We have same problem but different webhost.

Hi ha hagut un error.
http://www.arenyautes.cat/taxonomy/autocomplete/1

I've try your to add in progress.js and autocomplete.js solution but not resolve to me.
And also I've try this issue http://drupal.org/node/43415 didn't work.
How can I see output? If is because "[]" or other things?
thanks.
arenysorg

yorryk’s picture

@nheim

Thank you very much. Problem solved /000webhost/.

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.