getgrav/grav-plugin-random

Getting 404 on router /random

Closed this issue · 15 comments

http://chiefqualakon.net/random

Plugin is up to date and the plugin is a fresh install, route should be /random.

Looks like your routing is not working. it's not specific to 'random' plugin. That 404 is coming from the webserver/hosting provider. Check this out: http://learn.getgrav.org/troubleshooting/page-not-found

If you have more problems, ping is on Gitter chat via the website.

Routing works everywhere else, including the simplesearch plugin:
http://chiefqualakon.net/search/query:grav <-- routing works
http://chiefqualakon.net/random <-- routing doesn't work

If you can give me another example of a 404 page on my site I'd appreciate the example.

Random works fine for me. Maybe it randomly points to a page that's not published? Not sure if that's possible or already taken care by the plugin

$page = $collection->random()->current();

Could that be changed to allow only published articles?

Is that the problem? Did you try removing / publishing unpublished pages?

The ones I can't remove are the modular pages

Then this is not the problem, was just an idea.
Do you have configured the "Comma separated list of category names" configuration option of the plugin? Are there pages that satisfy that, as per https://github.com/getgrav/grav-plugin-random#usage?


You can see the list of posts here:
http://chiefqualakon.net/news
My guess is that it should be pulling a random article from here: http://chiefqualakon.net/news/category:news

I think I found it /user/config/random.yaml looks like this:

enabled: true
route: /random
redirect: true
filters:
  - news
filter_combinator: and

When I suspect it has to look like

enabled: true
route: /random
redirect: true
filters: { category: news}
filter_combinator: and    

My next question, is how can this be fixed by using the admin panel? I can download a backup to look at the config but don't have ssh/ftp access (currently) to change the format of the text.

Yah that does look like the problem. It's not finding anything to randomize. It probably is a bug with the random blueprint not outputting the data correctly. You will need to edit the file manually to fix. You can do this via SFTP if you don't have SSH access.

I could use Digital Ocean's console but I don't have (S)FTP or SSH access currently. Now that I know the problem I can rest easy. :)

Right now it's

    filters:
      type: selectize
      label: Category filter
      help: Comma separated list of category names
      validate:
        type: commalist

What type should it be? I'm assuming not commalist?

My guess for blueprints.yaml should be

    filters.category:
      type: selectize
      label: Category filter
      help: Comma separated list of category names
      validate:
        type: commalist

Taken from SimpleSearch