Show Sidebar Log in
Commons In A Box Logo
  • Home
  • About
    • Project Team
    • Logos and Graphics
  • Showcase
    • CBOX Classic Showcase
    • CBOX OpenLab Showcase
  • Demo
  • Get Started
  • Documentation
    • Technical Guide
    • CBOX Classic Guide
    • CBOX OpenLab Guide
  • Support Forums
    • CBOX Classic
    • CBOX OpenLab
    • Developers Forum
  • News

Group Admins

  • Profile picture of Scott Voth

CBOX Classic Support

Public Group active 4 months, 2 weeks ago

This group provides support for Commons In A Box Classic, our original software for community-building. Register for an account or log in to commonsinabox.org, then join the group and post your question here.

Can't create new Docs Upgrade weirdness?

  • This topic has 13 replies, 2 voices, and was last updated 11 years, 9 months ago by Dale MacDonald.
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • August 19, 2013 at 1:03 pm #3463
    Dale MacDonald
    Participant

    Since doing the WP 3.6 CBox 1.0.5 updates I now get a “You are browsing the archive for Posts.” page when I click on the “Create new doc” button in any group’s Doc page.

    FWIW I also saw the CBox theme options returning “0” bug but then it went away without my having applied the hotfix.

    Help?
    Dale.

    August 19, 2013 at 1:45 pm #3464
    Dale MacDonald
    Participant

    More FWIW the access log entry says
    64.79.125.74 – – [19/Aug/2013:13:41:10 -0400] “GET /wp-content/uploads/exports/cbox-theme/dynamic.js?ver=3.6 HTTP/1.1” 304 – “http://femtechnet.newschool.edu/docs/create/?group=commons-committee” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36”
    And nothing appears in the error log

    August 30, 2013 at 3:34 pm #3551
    Dale MacDonald
    Participant

    Bump!

    Any call to /docs/create whether raw or with a group name query results in a “You are browsing the archive for Posts.

    Not Found
    ” page.

    Any hints on where to look to debug this?

    Thanks,
    Dale.

    August 30, 2013 at 3:44 pm #3552
    Dale MacDonald
    Participant

    Curiously, Lisa Brundage thinks the buttons on the group Docs page should result in URLs of the form
    /groups/groupname/docs/create (which actually does create a new doc in the right place) where what is currently showing up is of the form /docs/create/?group=groupname

    Does this ring any bells?

    August 30, 2013 at 3:56 pm #3553
    Boone Gorges
    Keymaster

    Dale – Do you have FTP or file-level access to the server? Could you look at the file wp-content/plugins/buddypress-docs/loader.php and tell me what it says by “Version” in the plugin header? It should be 1.4.5.

    You may be having a problem with permalinks. Please go to Dashboard > Settings > Permalinks and re-save your current settings (this will regenerate any corrupt settings).

    Are you able to visit individual Doc pages without any problem? How about /docs/, the Docs directory?

    August 30, 2013 at 4:13 pm #3554
    Dale MacDonald
    Participant

    1.4.5

    Permalinks reset. No help.

    /docs works fine (though the add doc button there suffers the same fate).

    I did see this in templatetags.php which smelled funny

    	/**
             * Get the link to create a Doc
             *
             * @package BuddyPress_Docs
             * @since 1.2
             */
    	function bp_docs_get_create_link() {
    		return apply_filters( 'bp_docs_get_create_link', trailingslashit( bp_docs_get_archive_link() . BP_DOCS_CREATE_SLUG ) );
    	}
    

    is bp_docs_get_archive_link() right?

    Thanks,
    Dale.

    August 30, 2013 at 7:48 pm #3555
    Boone Gorges
    Keymaster

    Thanks, Dale. Yes, bp_docs_get_archive_link() is right. /docs/create *is* the correct link for the Docs create page. I’m a bit surprised that /groups/groupname/docs/create works at all – this is an error in the implementation.

    I’ve also been looking at the diff between 1.4.3 (the previous version of Docs included in Commons In A Box) and version 1.4.5 (the version currently included), and I can’t see anything that would affect something like this. Still, as a test, perhaps you could try getting the older version and replacing your newer version with it, just to test whether this actually is the culprit. You can get it from here: http://downloads.wordpress.org/plugin/buddypress-docs.1.4.3.zip

    Do single Docs resolve correctly? /docs/foo etc

    Can you say more about your server? Are you running a fairly vanilla Apache setup on Linux? I ask because the Create page is a kind of pseudo-page created by faking an endpoint within WP, and I wonder if something funny might be happening with the way your server is handling rewrites. On this same note, maybe you could test some places where similar rewrites are happening: for instance, editing or viewing the history of a single Doc. Do these work correctly? Here’s the place in the plugin where WP should be intercepted to create the pseudo-page: https://github.com/boonebgorges/buddypress-docs/blob/5caaee85522197d565a50635cfd18c2cc43a0635/bp-docs.php#L427 If you were going to debug, this would be the place to start. Maybe the check on 448 is failing? Or maybe the parse_query() method isn’t getting run at all?

    August 31, 2013 at 12:24 pm #3556
    Dale MacDonald
    Participant

    448 runs fine. the $posts_query looks like

    "name":"","post_type":"bp_doc","create":"1","error":"","m":0,"p":0,"post_parent":"","subpost":"","subpost_id":"","attachment":"","attachment_id":0,"static":"","pagename":"","page_id":0,"second":"","minute":"","hour":"","day":0,"monthnum":0,"year":0,"w":0,"category_name":"","tag":"","cat":"","tag_id":"","author_name":"","feed":"","tb":"","paged":0,"comments_popup":"","meta_key":"","meta_value":"","preview":"","s":"","sentence":"","fields":"","menu_order":"","category__in":[],"category__not_in":[],"category__and":[],"post__in":[],"post__not_in":[],"tag__in":[],"tag__not_in":[],"tag__and":[],"tag_slug__in":[],"tag_slug__and":[],"post_parent__in":[],"post_parent__not_in":[]},"tax_query":{"queries":[],"relation":"AND"},"meta_query":false,"post_count":0,"current_post":-1,"in_the_loop":false,"comment_count":0,"current_comment":-1,"found_posts":0,"max_num_pages":0,"max_num_comment_pages":0,"is_single":false,"is_preview":false,"is_page":false,"is_archive":true,"is_date":false,"is_year":false,"is_month":

    August 31, 2013 at 3:39 pm #3558
    Boone Gorges
    Keymaster

    Thanks. The next place to debug is https://github.com/boonebgorges/buddypress-docs/blob/5caaee85522197d565a50635cfd18c2cc43a0635/includes/theme-bridge.php#L39, where at line 55 $new_template should be set to single-bp_doc.php.

    September 2, 2013 at 11:51 pm #3559
    Dale MacDonald
    Participant

    bp_docs_template_include() returns from the if ( ! bp_docs_is_docs_component() ) clause with $template = /home/femtechnet/public_html/wp-content/themes/cbox-theme/archive.php

    It never gets to line 55

    • This reply was modified 11 years, 9 months ago by Dale MacDonald.
    September 3, 2013 at 7:39 am #3561
    Boone Gorges
    Keymaster

    Great, it sounds like this is where the problem is. The next step is to check why the bp_docs_is_docs_component() check is failing. Here’s the source: https://github.com/boonebgorges/buddypress-docs/blob/5caaee85522197d565a50635cfd18c2cc43a0635/includes/functions.php#L387 On the Create page, the first condition should be hit: is_post_type_archive( bp_docs_get_post_type_name() ). But apparently it’s not being evaluated to true.

    Could you do some further debugging from that point? Looking at how is_post_type_archive() is supposed to work, I’m guessing (and this is only an educated guess) that for some reason WP_Query is not setting the is_post_type_archive flag around here: http://core.trac.wordpress.org/browser/trunk/src/wp-includes/query.php#L1577 I can see from your $posts_query paste above that is_archive is set to true, but not is_post_type_archive, so something is amiss, though I can’t guess exactly what or why without further debugging.

    Thanks.

    September 4, 2013 at 12:17 am #3562
    Dale MacDonald
    Participant

    OK I’ve poked around a bit indeed is_post_type_archive( bp_docs_get_post_type_name() ) returning false.
    I’ve played a bit with wp-includes/query.php and I don’t see anything interesting if I put an else clause on

     if ( ! empty( $post_type_obj->has_archive ) )
    $this->is_post_type_archive = true;  
    

    so I’m not sure where above that we are running off the rails. Putting debug statements in parse-query() generates a whole lot of stuff and it frightens the users when it suddenly appears so I have to be judicious. Do you imagine a smarter place to trigger_error()?

    Thanks,
    Dale.

    September 4, 2013 at 9:32 pm #3563
    Boone Gorges
    Keymaster

    If you’re freaking out your users with debug stuff, just wrap it in if ( is_super_admin() ) {}. Hopefully you can keep plugging along and find a lead….

    September 5, 2013 at 1:39 am #3564
    Dale MacDonald
    Participant

    LOL It’s the other super-admins that freak out the most! :-O
    I’ve discovered in this process that there are a couple of other plugins that still have if ( WP_DEBUG) statements lurking in them. While I really need to get this problem fixed my server has decided to wedge an httpd process every 12 hours or so and run away with the CPU so I have to get that tamed first.

  • Author
    Posts
Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.
Log In
Group logo of CBOX Classic Support
  • Home
  • Forum
  • Announcements
  • Docs
  • Members 287
  • Send Invites

Groups

Newest | Active | Popular | Alphabetical
  • Group logo of CBOX Classic Support
    CBOX Classic Support
    287 members
  • Group logo of CBOX Pioneers
    CBOX Pioneers
    71 members
  • Group logo of CBOX Developers
    CBOX Developers
    40 members
  • Group logo of CBOX OpenLab Support
    CBOX OpenLab Support
    22 members
  • Group logo of CBOX-OL Testing Partners
    CBOX-OL Testing Partners
    12 members

CBOX has its roots in the CUNY Academic Commons, which in turn was made possible through funding from The City University of New York itself.

CUNY Logo

CUNY Academic Commons Logo

City Tech logo

The Commons In A Box was made possible through the generous support of the Alfred P. Sloan Foundation.

Alfred P. Sloan Foundation Logo

NEH Logo

The CUNY Graduate Center has directly contributed to the CUNY Academic Commons, housing the project since its inception, and has contributed to CBOX through its GC Digital Initiatives.

CUNY Graduate Center Logo

CUNY Graduate Center Digital Initiatives Logo

Powered by Commons In A Box
css.php
Skip to toolbar
  • About WordPress
    • WordPress.org
    • Documentation
    • Learn WordPress
    • Support
    • Feedback
  • Log In
  • Register