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

dev/core#105 Manage PCP URL Wrong for the notification email under wo… #12093

Merged
merged 1 commit into from
May 15, 2018

Conversation

aniesshsethh
Copy link
Contributor

…rdpress

Overview

Manage PCP URL Wrong for the notification email under wordpress

Before

https://domain/civi/?page=CiviCRM&q=civicrm/admin/pcp&reset=1

After

https://domain/wp-admin/admin.php?page=CiviCRM&q=civicrm/admin/pcp&reset=1

Technical Details

Just setting backend to true

@eileenmcnaughton
Copy link
Contributor

@aniesshsethh can you squash the commits now you have beaten jenkins

(git rebase -i origin/master should do it - although you will need to use -f switch to push)

@eileenmcnaughton
Copy link
Contributor

@kcristiano are you able to review?

@kcristiano
Copy link
Member

@eileenmcnaughton I'll take a look.

@kcristiano
Copy link
Member

@aniesshsethh

Can you detail the steps to reproduce? As you mention the notification email I won't be able to fully test on wpmaster.demo.civicrm.org so I'll take a look on one of my test sites.

My initial concern is if we change the url to the backend, the creator of the PCP page will have to have a user account and access to wp-admin. Once we can recreate the issue we may want to look if there is a permission that we can add to the anonymous user to solve this issue.

…rdpress

white space issue

more white space issue

another white space

another white space
@aniesshsethh
Copy link
Contributor Author

@eileenmcnaughton done

@kcristiano

I believe this will largely effect users which have a seperate front end template.

https://cl.ly/1608472H0r3x

Also, I believe this URL is only used in the admin notification and not in the emails to the creator of the campaign.

Please correct me if I am wrong

@kcristiano
Copy link
Member

@aniesshsethh Thank you for the details. I do see the issue in the initial notification emails. You are correct, the link sent in the admin notification should be a backend link (wp-admin as opposed to the basepage).

image

However, this brings up a related issue. The creator of the page cannot edit it as the only way to edit is via the backend. In fact, the email to the creator of the page tells them that they must login to their account to edit the page.
image

The notification of the approval also says this:

image

The issue is the user cannot login in unless the profile used to create the PCP includes an account creation link. Therefore we should update the docs to reflect this.

@aniesshsethh
Copy link
Contributor Author

aniesshsethh commented May 8, 2018

Okay, I am new and I am not sure if I am the right person for the job of updating the docs

https://cl.ly/0I3H3Q1O3a04

I think the docs suffeciently mention this, I think we need to update the language in the default template itself. Maybe additional clearer workflow around in regards to self editing of the PCP at the software level itself.

@kcristiano
Copy link
Member

@eileenmcnaughton @aniesshsethh I have tested this patch and the admin notification works as expected. The patch does fix the bug and can be committed from my testing on WP.

We should also test on Drupal and Joomla even though forcing backend should not have any negative affect there.

As far as the docs go, It does make it clear that a user must have an account to edit the page, but I did not see where the docs would let a CiviCRM Admin know that they have to require account creation in the profile used to create a PCP page if they want their constituents to be able to edit the page. In addition, adding language in the default template could make this message clearer to the user creating the PCP
image

As this reads now there is no mention that if you want to manage your page that you need to create an account.

@seamuslee001
Copy link
Contributor

ping @KarinG @jackrabbithanna I believe both of you have used PCP before would you care to comment on this?

@jackrabbithanna
Copy link
Contributor

looking in all the classes that inherit from Base.php, in CRM/Utils/System

Neither Drupal6, Drupal, Drupal8, DrupalBase, or Backdrop use that $forceBackend parameter to the url() function, there will be no affect there. Joomla.php and Wordpress.php are the only ones that do. I wonder if this has been a problem in Joomla too?

I don't have any Joomla sites to test against, but looking at the code its hard to see how it would cause a problem.

In Soap.php https://github.com/civicrm/civicrm-core/blob/master/CRM/Utils/System/Soap.php#L61
the url function doesn't include the $forceBackend parameter, and that's probably a separate issue and a bug waiting to be fixed sometime. I'm not sure how that Soap userSystem gets used. I do think that is beside the point of this issue.

Looks good to merge to me.

@eileenmcnaughton eileenmcnaughton added the merge ready PR will be merged after a few days if there are no objections label May 9, 2018
@eileenmcnaughton
Copy link
Contributor

I'm giving this 'merge-ready' - I'd like to hear Joomla! input (maybe @lcdservices ?) but I did ping on the channel & I'm not sure how else to get it.

However, I do think logically we have a question 'should this be frontend or backend' and if the answer is 'backend' then it makes sense that applies for both/all CMS & it's arguable how far we should go to test - esp on obscure functionality on PCPs

@eileenmcnaughton eileenmcnaughton merged commit d5c44ac into civicrm:master May 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge ready PR will be merged after a few days if there are no objections
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants