boonebgorges / buddypress-docs

GNU General Public License v3.0
106 stars 44 forks source link

Create Doc link always leads to Docs: Archives #615

Closed lordmatt closed 6 years ago

lordmatt commented 6 years ago

I've recently installed Docs on http://authorbuzz.co.uk and I have a problem in that the create docs link just takes me to the archives page with a "new doc" item which does not exist and links back to the archives page. I'm doing this as the super admin so it is not a permissions issue.

boonebgorges commented 6 years ago

Can you share the format of the URL that the Create link leads you to? This means both: (a) the link you see in your browser's status bar when hovering over the link (or what you see in the markup if you view source or inspect element), and (b) the format of the URL of the page where you end up. It should be of the format /docs/create/. Knowing whether (and how) your link diverges from this can help me figure out why you might be having the problem.

As a preemptive measure, you may also want to consider flushing your permalinks. Dashboard > Settings > Permalinks, and then click Save without making any changes.

lordmatt commented 6 years ago

All of the following are true for link and destination:

http://authorbuzz.co.uk/docs/create/ - leads to archives http://authorbuzz.co.uk/docs/create/?group=help-and-support - still archives http://authorbuzz.co.uk/docs/ - archives again http://authorbuzz.co.uk/docs/test/ - the test doc (created through backend) http://authorbuzz.co.uk/docs/my-groups/ - archives

Update: Flushed permalinks as suggested. Sadly, no change.

dcavins commented 6 years ago

Have you reset your permalinks? You can do so by visiting /wp-admin/options-permalink.php (wp-admin > settings > permalinks) and hitting the "Save" button. (You don't have to change anything. Although for BP and BP Docs to work, you will have to use some setting other than "plain".)

lordmatt commented 6 years ago

I use Day and name. If I had planned a little better I might have gone with name only but hay-ho.

I have flushed all caches (w3tc) I have flushed the permalinks I have flushed all caches (again)

The problem persists.

dcavins commented 6 years ago

W3TC seems like a clue. Does the problem occur if caching is disabled? I've always manually excluded /docs/ from caching (using super cache) because the results are user-specific, so can't be cached globally (at least not for logged-in users).

lordmatt commented 6 years ago

I have exempted docs from cache entirely and there is no change. w3tc does not cache for logged in users because that would be pretty pointless.

boonebgorges commented 6 years ago

The fact that your Archives page says "Archives: Docs" at the top suggests that Docs somehow isn't intercepting the request properly at all. This sounds like a problem with rewrite rules, but not necessarily.

@lordmatt As a next step in debugging, would it be possible for you to install and activate this plugin https://wordpress.org/plugins/rewrite-rules-inspector/, and then visit Dashboard > Tools > Rewrite Rules? Look in that list for a set of rules that starts with the string docs/. See screenshot for an example of what you might see.

screenshot_2018-02-08_16-32-12

dcavins commented 6 years ago

@lordmatt Did you resolve this issue? Can you share what the problem was?

lordmatt commented 6 years ago

I had given up and disabled the plugin because the community was clamouring for other things to be taken care of first. I will install the inspector and get back to you.

lordmatt commented 6 years ago

They seem to be made but the problem persists.

docs/create/?$ | index.php?post_type=bp_doc&name=$matches[1]&create=1 | other
-- | -- | --
docs/my-groups/page/([0-9]{1,})/?$ | index.php?post_type=bp_doc&my-groups=1&paged=$matches[1] | other
docs/my-groups/?$ | index.php?post_type=bp_doc&name=$matches[1]&my-groups=1 | other
docs/([^/]+)/edit/?$ | index.php?post_type=bp_doc&name=$matches[1]&edit=1 | other
docs/([^/]+)/history/?$ | index.php?post_type=bp_doc&name=$matches[1]&history=1 | other
docs/([^/]+)/delete/?$ | index.php?post_type=bp_doc&name=$matches[1]&history=1 | other
docs/([^/]+)/untrash/?$ | index.php?post_type=bp_doc&name=$matches[1]&untrash=1 | other
docs/([^/]+)/unlink-from-group/?$ | index.php?post_type=bp_doc&name=$matches[1]&unlink-from-group=1 | other

Can you tell me if any are missing?