cuny-academic-commons / commons-in-a-box

Commons In A Box - A suite of community and collaboration tools for WordPress, designed especially for academic communities
http://commonsinabox.org
72 stars 14 forks source link

"CBOX OpenLab" section in Dashboard > Menus is missing #459

Closed bree-z closed 6 months ago

bree-z commented 7 months ago

Hi Boone -

I'm noticing that the "CBOX OpenLab" section in Dashboard > Menus added in #195 no longer appears when creating new subsites on two different installations.

I first noticed this on SPS's installation, and I also see the same thing on https://unewhavendh.org/, which is not a new installation. I cannot reproduce it on BMCC's OpenLab (but could only test subsites, so I'm not sure what the template sites look like).

On SPS and UNH sites, I don't see the CBOX OpenLab section on template sites or on new subsites. On openlabdev.commonsinabox.org I also don't see the section on template sites, but I do see it on new subsites.

To test, I created a new template: https://openlabdev.commonsinabox.org/site-template-december-2023-template-1701679258/. The theme was Twenty Twenty Three, so I changed to Twenty Sixteen to check the Dashboard > Menus section. I created a new Course site using the template: https://openlabdev.commonsinabox.org/december-template-test/ The CBOX OpenLab section does appear on the new course site.

Thanks!

boonebgorges commented 7 months ago

The 'CBOX OpenLab' section at Dashboard > Menus was originally built so that it showed only on group sites. Group-type template sites don't technically belong to a group, so they were excluded from this. I've made a change in cc5275f that should fix this for template sites.

But now the 'CBOX OpenLab' section on these template sites is empty. That's because the link that should be there, '[ Project Home ]' (or whatever the group type is), uses data (like URL) from the connected group. In the case of templates, there is no connected group.

Complicating this is the fact that template sites should, by default, have both a 'Group Home' and a 'Home' link. So, when you go to Dashboard > Appearance > Menus on a site template, you already see a link corresponding to the '[Project Home]' link that you would see under CBOX OpenLab at the left. Now, I can see why you would want to have the ability to add this link back if you were to delete it. But it raises questions about the desired workflow.

So can you please think through how you want all of this to work?

On SPS and UNH sites, I don't see the CBOX OpenLab section on template sites or on new subsites.

I can't reproduce the issue with "new subsites". I see the 'CBOX OpenLab' section on regular group sites. For further debugging, I would need access to an installation where I have access to the codebase.

bree-z commented 7 months ago

Thanks, Boone.

I don't think it's a problem if the CBOX OpenLab section doesn't appear in Dashboard > Appearance > Menus on a site template. I had noticed that it does appear on a few site templates (e.g. https://openlabdev.commonsinabox.org/site-template-course-1596809801/wp-admin/nav-menus.php, https://openlabdev.commonsinabox.org/site-template-project-1596809804/wp-admin/nav-menus.php, https://openlabdev.commonsinabox.org/project-site-template-2/wp-admin/nav-menus.php) and it also appears on site templates on CT OL, so I wasn't sure if that was a bug or not. Since it's not, I think it's fine to leave as is. Sorry for any confusion.

The main reason for this ticket was to figure why the CBOX OpenLab section wasn't appearing on any new sites created using any of the site templates. I was able to reproduce the issue on a test install, and I can give you SSH access if that would help.

Thanks!

boonebgorges commented 7 months ago

The main reason for this ticket was to figure why the CBOX OpenLab section wasn't appearing on any new sites created using any of the site templates. I was able to reproduce the issue on a test install, and I can give you SSH access if that would help.

Sure, please reach out privately with SSH and WP credentials so that I can reproduce.

boonebgorges commented 7 months ago

I've looked at the site info that you shared, @bree-z

The meta box is there, it's just hidden. See the Screen Options tab. I'm unsure why the box is unchecked in this case, or why it's different for non-super-admins.

It's possible for me to add a filter that causes it always to be shown, but this will render the checkbox in Screen Options inoperable - it'll be impossible to hide it.

My recommendation is that we do nothing. The option is available to enable if necessary. And Dashboard > Menus is increasingly unused: it's not used at all in block themes, and even for non-block themes it was largely deprecated in favor of the Menus interface in the Customizer. Getting to the bottom of the default "hidden" behavior is likely to be far more trouble than it's worth.

bree-z commented 6 months ago

Thanks so much Boone!

I think your recommendation makes sense.