Lack of interest Assign Route Filters to addons

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.
This suggestion has been closed. Votes are no longer accepted.
I personally feel that no add-on should make such a decision for an end user. So, for that reason, I'm against this.
 
I personally feel that no add-on should make such a decision for an end user. So, for that reason, I'm against this.

My suggestions isn't really because of the possibility to share them with others
It's to not have to do the changes manual on all the instances (dev, test, live) Just like with the suggestion to be able to export the options:D
 
If anything, it should export to a separate file. No add-on should have the power to over write options / routes on install (I guess you could add them via PHP).

If this existed, you know add-on authors would do this and inadvertently screw up users sites.
 
Yeah how about exporting filters in general? I see the merit in being able to share the same ones across sites, but it shouldn't be tied to addons.
 
I would like to throw my 2p into the argument.

I think distributing route filters with add-ons has a valid use case. I'm actually doing it with Xen Media Gallery 2.0.

PHP:
        $filterExists = $db->fetchRow('
            SELECT *
            FROM xf_route_filter
            WHERE find_route = ?
        ', 'xengallery/');

        if (!$filterExists)
        {
            $routeFilterWriter = XenForo_DataWriter::create('XenForo_DataWriter_RouteFilter');

            $routeFilterWriter->bulkSet(array(
                'route_type' => 'public',
                'prefix' => 'xengallery',
                'find_route' => 'xengallery',
                'replace_route' => 'media',
                'enabled' => 1,
                'url_to_route_only' => 0
            ));

            $routeFilterWriter->save();
        }

Why?

Simple. When I first created Xen Media Gallery, the default route of the add-on was "media". Straight away it became apparent that this would:
inadvertently screw up users sites.

It would clash with other add-ons using the same route. I could have changed it to gallery. But no doubt one day that would clash too. If XenForo released an official gallery, that may cause issues too.

So I made the change so that my add-on was shipped with the route "xengallery".

I implemented my own route changer type system so that it was easy to change "xengallery" to "media" and I shipped that with the default option.

Since the Route Filters came along, I can use the above code in the installer to create the route filter if it doesn't exist and later remove it during uninstall. I'm happy to carry on doing this, but I'd much rather that process be handled by XenForo and be more closely tied with the add-on system. As well as creating and removing the route filter, I'd like to see that being upgraded by an add-on upgrade and disabling it if the add-on is disabled.

The latter in itself goes some way to mitigate the issue of a site being screwed up by an add-on or causing problems with others. But, of course, they can be disabled in the Admin CP easily enough anyway. And there's just as much chance of someone screwing up an install using my code above, as there is if a route filter was added using an add-on XML.

So, hopefully, this might still be considered when the time is right :)
 
Back
Top Bottom