Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing is_public flags to public paths #14945

Merged
merged 1 commit into from
Aug 2, 2019

Conversation

JKingsnorth
Copy link
Contributor

Overview

The menu definition has a flag for 'is_public' that defines if a path can be viewed by 'the public'. Sometimes this includes 'the public, but with the right permissions (eg: 'make online contribution' pages are still 'public').

This PR adds the is_public flag to all pages that have an access callback of '1', but are missing the 'is_public' flag.

The exception is the 'civicrm/admin/scheduleReminders' path. Although it has an access callback of 1 it is not a public page, and some weird logic has been implemented to make it visible in the correct circumstances (see https://github.com/civicrm/civicrm-core/pull/6126/files)

An additional fix included is a very old typo (by the looks of it) next to the 'scheduled reminders' title field.

Before

Public paths were missing the is_public flag

After

More paths are flagged as is_public

Technical Details

Changes to XML menu definitions that will be automatically rebuilt into the DB on a cache rebuild.

@civibot
Copy link

civibot bot commented Aug 1, 2019

(Standard links)

@civibot civibot bot added the master label Aug 1, 2019
@eileenmcnaughton
Copy link
Contributor

@JKingsnorth what are the practical impacts of this? I'm guessing you hit some weirdness on one of them & decided to cleanup across all of them?

@seamuslee001
Copy link
Contributor

@eileenmcnaughton isn’t it the is_public key what defines if something is front end or not in Drupal for the theme subsystem?

@eileenmcnaughton
Copy link
Contributor

@seamuslee001 I would think so - but these seem like strange paths to have encountered theming concern on

@JKingsnorth
Copy link
Contributor Author

I think the only functional uses are in CRM_Core_Invoke. It is used to set the breadcrumb, perform the 'statusCheck' appropraitely and set the 'urlIsPublic' template variable which is mentioned in 4 templates.

But this is more for consistency in case things people develop are relying on is_public being set consistently across all pages/paths that should be accessible to public users.

We had something in mind for this, which is what made me notice the inconsistency.

@seamuslee001
Copy link
Contributor

This makes sense to me i think we should do this merging

@seamuslee001 seamuslee001 merged commit 22f2481 into civicrm:master Aug 2, 2019
@jensschuppe
Copy link
Contributor

Can someone explain why CRM_Report_Page_InstanceList and CRM_Report_Page_Instance should be marked public, just because there is no generic access callback? This PR indeed causes all reports be displayed using the "Public" theme, which is different behavior compared to versions prior to 5.17.0. Honestly, I would call this a UI regression, since there is no way to restore the "old" behavior.

@JKingsnorth
Copy link
Contributor Author

Hiah, yes there is no access callback, so the pages can be displayed to the public, so I gave them the is_public flag.

This causing the pages to render in the 'public' theme is an unintended consequence. So I can see the argument for removing the is_public flag from these paths, since they're not really 'public' in any use case I can think of. I can create a PR for this.

@jensschuppe
Copy link
Contributor

I can create a PR for this.

That would be much appreciated, thanks.

I'm not totally convinced though that having no generic access callback is the same as being a public page - what actually denotes a CiviCRM page being "public" (compared to "not really public") apart from potentially being rendered in a different theme (asking out of curiosity)?

@JKingsnorth
Copy link
Contributor Author

what actually denotes a CiviCRM page being "public" (compared to "not really public") apart from potentially being rendered in a different theme (asking out of curiosity)?

Nothing, just the 'is_public' flag, and the 'intended use' of the page. The aim of this PR was just to tighten up the use of the flag, so that it can be more useful.

The is_public flag sets the theme, and a variable on the page. But it is useful to have. We use the is_public flag so that we can block all access to 'non-public' pages from outside our administration network, for example.

@JKingsnorth
Copy link
Contributor Author

See #15261

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants