Originally reported by @blackundertone on Github:

https://github.com/farmOS/farm_area/issues/1

Comments

m.stenta created an issue. See original summary.

m.stenta’s picture

The issue is the AJAX request that happens in farm_area.openlayers.popup.js:

          jQuery.getJSON(Drupal.settings.basePath + 'farm/area/' + area_id + '/details', function(data) {
            if (data) {
              area_details.html(data);
              options.overlay.setPosition(options.evt.coordinate);
            }
          });

Drupal.settings.basePath does not automatically include index.php?q= when clean URLs are turned off.

The choice seems to be:

* Include some Javascript that will try to detect whether or not clean URLs are enabled, and adjust the URL accordingly. For an example of this, here is an issue in the Views module that fixed something similar: #1359798: Clean urls off break all Ajax views
* Somewhere in the farm_area module's PHP, use drupal_add_js() to detect whether or not clean URLs are enabled, and push a Javascript setting with the appropriate base url that can be used in the JS code above.

Neither feels particularly "clean" to me (pun intended). I really wish we could just keep it simple the way it is.

Should we just make clean URLs a requirement of farmOS?

m.stenta’s picture

Status: Active » Postponed

Postponing this until we get some more opinions on the matter. ;-)

m.stenta’s picture

Project: Farm Area » farmOS
Component: User interface » Farm Areas

All farmOS repositories have been merged into the farmOS distribution (see #2876992: Merge farmOS repositories into drupal.org/project/farm). I'm going through and moving all open issues from the various project issue queues to the central queue now...

m.stenta’s picture

@quicksketch's (old) comment in a related core issue suggests the second approach I described in my comment #2 above: https://www.drupal.org/node/481560#comment-4664122

  • m.stenta committed e2ece5e on 7.x-1.x
    Issue #2774957: Area popup doesn't work when clean URLs are disabled
    
m.stenta’s picture

Status: Postponed » Fixed

I passed the base path in as a JS setting. This is fixed now.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.