https://redmine.gc.cuny.edu/https://redmine.gc.cuny.edu/favicon.ico2015-06-26T16:14:47ZCUNY Graduate Center - Project Tracking SystemCUNY Academic Commons - Bug #4199: Create a Site, Privacy Settingshttps://redmine.gc.cuny.edu/issues/4199?journal_id=197762015-06-26T16:14:47ZBoone Gorgesboone@gorg.es
<ul><li><strong>Tracker</strong> changed from <i>Design/UX</i> to <i>Bug</i></li><li><strong>Status</strong> changed from <i>New</i> to <i>Assigned</i></li><li><strong>Assignee</strong> changed from <i>Boone Gorges</i> to <i>Daniel Jones</i></li><li><strong>Target version</strong> set to <i>1.9</i></li></ul><p>There must be some bug that's causing it not to be there during the inital pageload.</p>
<p>Ideally, privacy setting would reflect our 5 settings, as defined in wp-content/mu-plugins/ds_wp3_private_blog.php.</p> CUNY Academic Commons - Bug #4199: Create a Site, Privacy Settingshttps://redmine.gc.cuny.edu/issues/4199?journal_id=197792015-06-26T16:32:54ZRaymond Hoh
<ul></ul><p>I took a quick look at this and it appears we're using a custom create blog template with a custom signup form function:<br /><a class="external" href="https://github.com/cuny-academic-commons/cac/blob/1.8.x/wp-content/themes/bp-nelo/blogs/create.php#L16">https://github.com/cuny-academic-commons/cac/blob/1.8.x/wp-content/themes/bp-nelo/blogs/create.php#L16</a></p>
<p>This might be the reason why we're not inheriting the privacy block here.</p>
<p>Probably reverting to the original template by deleting <code>/blogs/create.php</code> or by changing <code>cac_show_blog_signup_form()</code> to <code>bp_show_blog_signup_form() </code> should fix this.</p> CUNY Academic Commons - Bug #4199: Create a Site, Privacy Settingshttps://redmine.gc.cuny.edu/issues/4199?journal_id=197952015-06-27T16:44:46ZDaniel Jonesdrjones18@gmail.com
<ul></ul><p>Yes doing either of the changes that Ray suggested bring back a privacy setting - although it only shows 2 options, for hiding or not hiding the blog from search results. I can work to try and make it reflect the 5 options now though.</p> CUNY Academic Commons - Bug #4199: Create a Site, Privacy Settingshttps://redmine.gc.cuny.edu/issues/4199?journal_id=197962015-06-27T17:55:31ZDaniel Jonesdrjones18@gmail.com
<ul></ul><p>So there was a function is ds_wp3_priave_blog.php called "show privacy options" that was hooked into the admin options screen for sites, and the file also had a commented-out add_action call that hooked it into the blog create form.</p>
<p>The function only listed out options for -1, -2, and -3 though, and not 0 or 1. What I did was modify it to include 0 and 1 and also un-commented the call that hooked it into the blog create form. Now all 5 options are showing up on the blog create page, but I can't seem to get it to respect the option that I set. Any thoughts?</p> CUNY Academic Commons - Bug #4199: Create a Site, Privacy Settingshttps://redmine.gc.cuny.edu/issues/4199?journal_id=198002015-06-29T13:08:45ZBoone Gorgesboone@gorg.es
<ul></ul><p>Modifying ds_wp3_private_blog.php is fine.</p>
<blockquote>
<p>Now all 5 options are showing up on the blog create page, but I can't seem to get it to respect the option that I set. Any thoughts?</p>
</blockquote>
<p>Not off the top of my head. First place I'd look is bp_blogs_validate_blog_signup(). Either (a) BuddyPress is not recognizing negative values, or (b) the markup being generated for the extra privacy levels doesn't share the same "name=blog_public", so it's not being recognized when processing the form.</p> CUNY Academic Commons - Bug #4199: Create a Site, Privacy Settingshttps://redmine.gc.cuny.edu/issues/4199?journal_id=198012015-06-29T13:50:50ZDaniel Jonesdrjones18@gmail.com
<ul></ul><p>I think I've got this working now: <a class="external" href="https://github.com/cuny-academic-commons/cac/commit/e426ca29bbf58e171a2a6b5de87cda3996d4375b">https://github.com/cuny-academic-commons/cac/commit/e426ca29bbf58e171a2a6b5de87cda3996d4375b</a></p>
<p>So it turned out the main issue here is with the wpmu-new-blog-defaults plugin, in particular the cets_blog_defaults.php file. The plugin was overriding the privacy setting with the default even when one had been provided on signup. I made the change directly to the plugin for now but let me know if you see a better option.</p>
<p>In order to make the extra privacy settings work right both on the signup form and the admin pages, I had to create a separate function for each context, because we have to output all 5 options on the form, but in the admin pages Wordpress automatically outputs the 2 standard options, so we only need to add in the 3 extra ones. Made the changes in the ds_wp3_private_blog MU plugin.</p>
<p>Let me know if you think this works.</p> CUNY Academic Commons - Bug #4199: Create a Site, Privacy Settingshttps://redmine.gc.cuny.edu/issues/4199?journal_id=198042015-06-29T22:10:18ZBoone Gorgesboone@gorg.es
<ul></ul><p>Thanks, Dan. In theory, it'd be nice if the options were compartmentalized in such a way that they didn't have to be repeated in various places - we also repeat it in plugins/cac-bp-custom-includes/groupblog.php. But maybe that's a good project for a rainy day.</p>
<p>Dan, can you please verify that settings are sticking in the following cases:</p>
<p>- Creating a new site /blogs/create<br />- Creating a new site after initial failure at /blogs/create<br />- Existing site Dashboard > Settings > Reading<br />- Creating a new groupblog (group Manage > Group Blog)</p> CUNY Academic Commons - Bug #4199: Create a Site, Privacy Settingshttps://redmine.gc.cuny.edu/issues/4199?journal_id=198762015-07-15T15:40:38ZDaniel Jonesdrjones18@gmail.com
<ul></ul><p>Looks like it's working in each case you outlined: <a class="external" href="https://github.com/cuny-academic-commons/cac/commit/92cbf19bb75e08c19c1af3e86ae45236ddc5c47d">https://github.com/cuny-academic-commons/cac/commit/92cbf19bb75e08c19c1af3e86ae45236ddc5c47d</a></p>
<p>I also removed the function for displaying the radio buttons at the top of the SuperAdmin->Sites->Edit screen because of the issue I mentioned on the call with it getting overridden, and had to add some logic to the plugin to get it to skip outputting the options in group-related screens, because it was creating a duplicate options section to one that was already there, which included all 5 of our options.</p> CUNY Academic Commons - Bug #4199: Create a Site, Privacy Settingshttps://redmine.gc.cuny.edu/issues/4199?journal_id=198982015-07-16T18:27:16ZBoone Gorgesboone@gorg.es
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Resolved</i></li></ul><p>This looks good to me. I'm going to leave this in the 1.9 milestone, as it involves some fairly extensive changes. Thanks, Dan!</p>