BuddyDev

Search

[Resolved] Having an issue with slug/mpp_gallery_post_type

  • Participant
    Level: Initiated
    Posts: 8
    Micah Coffey on #610

    This used to work at some point, so it’s probably a conflict of some sort. I’d like to attempt fixing it without tearing my site down if possible.

    When I goto username/mediapress/create and hit submit, I get a 404 because it attempts going to http://www.mydomain.com/mpp-gallery/… instead of http://www.mydomain.com/myslug/… but the gallery is still created, which I find odd.

    So then in core/common/functions.php I see “If you are a plugin author, please avoid the temptation to change the slug unless it is very important I have left it but it should be used with utmost caution”
    I’m confused, is this old? I set my slug with the wordpress/settings/buddypress/pages/gallery dropdown. I’ve also attempted define MPP_GALLERY_SLUG in bp-custom.

    I am able to view albums I created but clicking upload or delete just refreshes the page with two /’s after the username(not exactly sure which variable is missing at this point)

    When I set the slug to mpp-gallery I don’t get a 404 on creation but the upload and delete links still have a busted url.

    Anyone have any ideas at all? Anything related to slugs or variables getting dropped in the url creation.. Thanks.

  • Keymaster
    (BuddyDev Team)
    Posts: 24149
    Brajesh Singh on #612

    Hi Micah,
    I am sorry for the trouble.
    Most probably one of the plugin you are using is filtering post_type_permalink incorrectly.
    Also, If you have set MPP_GALLERY_SLUG, what is the value.

    There is no harm in setting the MPP_GALLERY_SLUG slug, the message is for the post type slug. MPP_GALLERY_SLUG is different and only changes the ‘mediapress’ part of your url and I strongly recommend changing it to something like gallery or album etc to make it better.

  • Participant
    Level: Initiated
    Posts: 8
    Micah Coffey on #613

    Thank you for such a quick reply! I think at this point the easiest thing to ask would be, why would clicking submit on create new gallery attempt going to domain.com/wpp-gallery instead of the slug set via wordpress/buddypress/pages/gallery dropdown? I have a feeling this is the root of the issue.

    Thanks either way, looks like I will have to rip everything apart at some point and see if I can locate the conflict.

    Thanks for your hard work.

  • Keymaster
    (BuddyDev Team)
    Posts: 24149
    Brajesh Singh on #614

    Hi Micah,
    The page you are referring to is our directory page and It has no role in gallery creation.
    When you click submit button a gallery is created and in normal case you should be redirected to its add media page but it seems the returned url is incorrect. It should never use mpp-gallery in the url( That is the post type slug) for members gallery.

    Can you please provide me the code that you have used to define the MPP_GALLERY_SLUG

  • Participant
    Level: Initiated
    Posts: 8
    Micah Coffey on #615

    define( ‘MPP_GALLERY_SLUG’, ‘photos’);
    I do not remember this doing anything more than wordpress/buddypress/pages/gallery dropdown.

    Yes the fact that mpp-gallery pops into the url is confusing me but thank you for clarifying mpp-gallery is the directory page, I will go attempt changing your plugins settings for the directory and see if I notice anything.

    I just realized, maybe this directory page slug and my username/slug are conflicting due to me trying to configure them the wrong way. Another thing I just thought about is I am using a define() or plugin that changes my urls from domain.com/members/membername to domain.com/membername, I’ll see if this has any role in the issue.

    Thanks again!

  • Participant
    Level: Initiated
    Posts: 8
    Micah Coffey on #619

    So I just realized the wordpress/buddypress/pages/gallery dropdown is for the directory page and the define MPP GALLERY SLUG is for the user’s slug..

    So I goto a user, click gallery and see the galleries for that user.. if I click any links, the title, view, upload or delete, it goes to domain.com/mpp-gallery/’galleryname’//manage/add?_wpnone=###&gallery_id=152.

    I noticed this page has an error in the console(which I somehow can’t reproduce now without changing anything): GET file domain.com/snarf/mediapress(something, can’t remember). The issue is ‘snarf’ is a user, but not the one I am attempting to view a gallery for.

    What would I have to do to ‘reset’ mediapress? Clean plugin install and clear some database entries? Thanks again!

  • Keymaster
    (BuddyDev Team)
    Posts: 24149
    Brajesh Singh on #620

    Hi Micah,
    Thank you for the details but it still seems to me a conflict with some other code or plugin.

    Which plugins are you using? Is there any plugin that is filtering post permalinks? MediaPress settings won’t make much difference. You can just view MediaPress->settings and update them if you want.

  • Participant
    Level: Initiated
    Posts: 8
    Micah Coffey on #623

    I have 41 plugins at the moment :/ some for testing, most for production. That is why I tried bugging you instead of turning stuff off. You have helped me a lot so far though, I have a better understanding of whats going on after talking with you, thank you very much.

    One last favor if you get a chance, mpp-gallery/’galleryname’// <– what is missing there? Maybe I can track that down.

    Thanks a hundred more times!

    I’ll let you know what the final result is.

  • Participant
    Level: Initiated
    Posts: 8
    Micah Coffey on #624

    https://wordpress.org/plugins/custom-post-type-permalinks/

    This is the culprit. Deactivating this plugin makes the links work properly.

    With the plugin active, I am able to get to the pages if I have the right link.

    Thanks again for your time, hopefully this saves someone else the trouble.

  • Keymaster
    (BuddyDev Team)
    Posts: 24149
    Brajesh Singh on #625

    Hi Micah,
    Thank you.
    i just had a look at that plugin and I see that they are filtering the post type permalink as I guessed earlier here.

    https://github.com/torounit/custom-post-type-permalinks/blob/master/CPTP/Module/Permalink.php#L17

    If they change the priority to higher or we decrease our priority, that will solve the issue for future.

    Thank you for posting the details and I am sure, It will help others too.

You must be logged in to reply to this topic.

This topic is: resolved