Skip to:
Content
Pages
Categories
Search
Top
Bottom

Editing topics and replies in bbPress 2.0


  • pimarts
    Participant

    @pimarts

    Ok, just to see if everyone’s experiencing the same behaviour or something’s “wrong” at my end:

    When I click on the edit link for a topic (first post) the link returns me to the topic page. (I would have hoped to edit the topic / post) So that doesn’t seem to be working. Maybe it’s because of the time constraint that allows you to edit topics/replies? I would like to disable that time constraint anyway. Any options there?

    When I click on the edit link for a reply in that topic it shows me a page with the content of the page stripped and a “Edit this entry” link, if I click on that it sends me to wp-admin (with the post open to edit). Is there no “front-end” editing of the topic/reply possible? I’d like to keep people out of the admin as much as possible.

    That’s happening when I’m an admin, when I’m a subscriber I don’t even see the edit links (although I have the “edit_replies” / “edit_topics” capabilities).

    I’m running bbPress 2.0 RC1 – 3363. (Just in case it matters: I started out with the beta that’s in the WordPress repository and replaced it twice with updated versions from the trac.)

Viewing 14 replies - 1 through 14 (of 14 total)

  • John James Jacoby
    Keymaster

    @johnjamesjacoby

    Editing topics and replies has been working for months, and I’m not able to duplicate any of what you’re mentioning on several installs.

    If you have passed the time limit on editing topics or replies, the link no longer appears, so that isn’t the problem. :)

    The edit links are always available to admins, regardless of the time limit set.

    Sounds to me like something is wrong with your install somewhere. Most likely custom template files?


    pimarts
    Participant

    @pimarts

    Thanks for looking into it! Guess I’ll need to dig a bit deeper in this then. I don’t use any custom bbPress template files by the way. (I do run buddyPress and custom post types, maybe something strange is going on in there).

    Guess I need to find out what page is being loaded / looked for when it re-directs from /edit/ to the topic.

    Edit: Seems it’s loading /mytheme/page.php (a child-theme copy of bp-default/page.php), but the re-direction happens before loading that page…

    Edit2: Disabling all plugins (aside from buddypress & bbpress) and the stuff in functions.php didn’t help either.


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    Maybe try visiting your permalinks page and seeing if flushing the rewrite rules helps? The ‘/edit’ is a special rewrite rule, so it’s possible they never got reset.


    pimarts
    Participant

    @pimarts

    Yeah I tried that a couple of times already, because I remembered that being a problem in the beginning.

    I have a custom structure with “/%category%/%postname%/” at common settings. And the optional fields are blank.

    I’ll probably have to look into the WordPress & Buddypress files to see where they do a 301 re-direct. Because when I installed httpfox and did record a session I saw the browser getting a 301 re-direct.

    This is in my htaccess file by the way:


    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    And this from the W3 Total Cache plugin too:


    # BEGIN W3TC Page Cache core
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^(.*/)?w3tc_rewrite_test$ $1?w3tc_rewrite_test=1 [L]
    RewriteCond %{HTTP_USER_AGENT} (2.0 mmp|240x320|alcatel|amoi|asus|au-mic|audiovox|avantgo|benq|bird|blackberry|blazer|cdm|cellphone|danger|ddipocket|docomo|dopod|elaine/3.0|ericsson|eudoraweb|fly|haier|hiptop|hp.ipaq|htc|huawei|i-mobile|iemobile|j-phone|kddi|konka|kwc|kyocera/wx310k|lenovo|lg|lg/u990|lge vx|midp|midp-2.0|mmef20|mmp|mobilephone|mot-v|motorola|netfront|newgen|newt|nintendo ds|nintendo wii|nitro|nokia|novarra|o2|openweb|opera mobi|opera.mobi|palm|panasonic|pantech|pdxgw|pg|philips|phone|playstation portable|portalmmm|bppcb|proxinet|psp|qtek|sagem|samsung|sanyo|sch|sec|sendo|sgh|sharp|sharp-tq-gx10|small|smartphone|softbank|sonyericsson|sph|symbian|symbian os|symbianos|toshiba|treo|ts21i-10|up.browser|up.link|uts|vertu|vodafone|wap|willcome|windows ce|windows.ce|winwap|xda|zte) [NC]
    RewriteRule .* - [E=W3TC_UA:_low]
    RewriteCond %{HTTP_USER_AGENT} (acer s100|android|archos5|blackberry9500|blackberry9530|blackberry9550|blackberry 9800|cupcake|docomo ht-03a|dream|htc hero|htc magic|htc_dream|htc_magic|incognito|ipad|iphone|ipod|kindle|lg-gw620|liquid build|maemo|mot-mb200|mot-mb300|nexus one|opera mini|samsung-s8000|series60.*webkit|series60/5.0|sonyericssone10|sonyericssonu20|sonyericssonx10|t-mobile mytouch 3g|t-mobile opal|tattoo|webmate|webos) [NC]
    RewriteRule .* - [E=W3TC_UA:_high]
    RewriteCond %{HTTP_COOKIE} w3tc_referrer=.*(google.com|yahoo.com|bing.com|ask.com|msn.com) [NC]
    RewriteRule .* - [E=W3TC_REF:_search_engines]
    RewriteCond %{HTTPS} =on
    RewriteRule .* - [E=W3TC_SSL:_ssl]
    RewriteCond %{SERVER_PORT} =443
    RewriteRule .* - [E=W3TC_SSL:_ssl]
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteRule .* - [E=W3TC_ENC:.gzip]
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} =""
    RewriteCond %{REQUEST_URI} /$ [OR]
    RewriteCond %{REQUEST_URI} (sitemap.xml(.gz)?) [NC]
    RewriteCond %{REQUEST_URI} !(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|index.php) [NC,OR]
    RewriteCond %{REQUEST_URI} (wp-comments-popup.php|wp-links-opml.php|wp-locations.php) [NC]
    RewriteCond %{HTTP_COOKIE} !(comment_author|wp-postpass|wordpress_[a-f0-9]+|wordpress_logged_in) [NC]
    RewriteCond %{HTTP_USER_AGENT} !(W3 Total Cache/0.9.2.3) [NC]
    RewriteCond "%{DOCUMENT_ROOT}/wp-content/w3tc/pgcache/%{REQUEST_URI}/_index%{ENV:W3TC_UA}%{ENV:W3TC_REF}%{ENV:W3TC_SSL}.html%{ENV:W3TC_ENC}" -f
    RewriteRule .* "/wp-content/w3tc/pgcache/%{REQUEST_URI}/_index%{ENV:W3TC_UA}%{ENV:W3TC_REF}%{ENV:W3TC_SSL}.html%{ENV:W3TC_ENC}" [L]
    </IfModule>
    # END W3TC Page Cache core

    But taking that out (the W3TC stuff) doesn’t change anything, so the problem isn’t in there.


    pimarts
    Participant

    @pimarts

    Just trying all kinds of stuff now. Disabling BuddyPress didn’t help either.

    Is there any way I can see what file WordPress is looking for before it re-directs? Or in what file the re-direct takes place? (I know this question is not really bbPress related, but maybe you know the answer anyway).


    pimarts
    Participant

    @pimarts

    Final addition, I’m giving up on this for now:

    I run a child theme of bp-default.

    I have files for archive.php, comments.php, footer.php, functions.php, header.php, index.php, page.php, search.php, single.php and type.php in my theme dir. That’s it.

    Everything seems to work aside from the editing of topics. I tried copying single-reply-edit.php and single-topic-edit.php to my theme dir, but that didn’t help either.

    With this info, any ideas now? Like I said, I’m giving up. I pretty much tried anything I could think of by now. Sorry to bother you with this :)


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    Do you have any other bbPress template files in your theme, or are you relying on bbPress Theme Compat to work correctly?


    pimarts
    Participant

    @pimarts

    The ones I listed above are the only files I have in my theme. I always thought the less, the better, because of upgrades ;)

    I actually joined just to post this exact problem.

    I managed to figure it out after reading this!

    You were right when you suggested it could be to do with the permelinks because I was using the exact same custom structure of “/%category%/%postname%/” and had the same problem.

    The solution is either a)

    Use the default link structure or

    B)

    edit function ‘bbp_get_topic_edit_link’ in file

    wp-content/plugins/bbpress/bbp-includes/bbp-topic-template.php

    with this line of code

    $uri .= ‘?edit=1’;

    just before it returns.

    Then do the same for

    wp-content/plugins/bbpress/bbp-includes/bbp-reply-template.php

    with function ‘bbp_get_reply_edit_link’

    So now the edit url should look like

    http://beta.guildwars2community.com/forums/topic/ranger-pets/?edit=1

    I hope this helps!


    pimarts
    Participant

    @pimarts

    Thanks a lot for that reply, going to test it out in my beta enviroment right now ;)


    pimarts
    Participant

    @pimarts

    You sir (?), are a genius!

    Thanks a lot for making this work, going to implement it in the live site right away.

    JJ, any way of implementing this in newer versions of RC? Or maybe fixing it in a different way?

    Glad it worked for you also.

    I think it should be implemented in a different way also.

    I just hacked it together because I dont really know the proper way of getting it to work.


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    Fixed in branch. Will be fixed in next release.

    https://bbpress.trac.wordpress.org/ticket/1594

    @slithx0r

    If using the default theme, where exactly would I add/edit the function ‘bbp_get_topic_edit_link’ with the code:

    $uri .= ‘?edit=1’;

    in bbp-topic-template.php?

    Sorry not the best with php!

Viewing 14 replies - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.
Skip to toolbar