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

CRM-17633 WIP Changes to support WP in it's own directory … #105

Merged
merged 4 commits into from
Oct 2, 2017

Conversation

kcristiano
Copy link
Member

… Replaced #103

@kcristiano
Copy link
Member Author

dependency- civicrm/civicrm-core#9106

@christianwach
Copy link
Member

@kcristiano Thanks for working on this. I have a couple of queries:

  • I see that the CRM_Utils_System_WordPress::getBaseUrl() and CiviCRM_For_WordPress::get_base_url() methods are now identical. Would it not be simpler to change the method access for CRM_Utils_System_WordPress::getBaseUrl() to public and then we could dispense with get_base_url() entirely?
  • Is there a reason for using a hard-coded directory name? There are a number of ways of changing from 'wp-admin' to something else: e.g. this plugin and this technique.
  • Finally, is there any assumption about whether or not WordPress is bootstrapped when either CRM_Utils_System_WordPress::getBaseUrl() or CiviCRM_For_WordPress::get_base_url() is called? If WordPress is always bootstrapped, then wouldn't it make more sense to use native WordPress functions to discover the URL?

Cheers, Christian

@kcristiano
Copy link
Member Author

@christianwach Thanks for the feedback.

  • it's possible we could change the method - I am trying to keep compatibility with other code. Backwards compatibility and all :)
  • I am using 'wp-admin' hardcoded as my attempts to get it to return via the admin_url failed due to issues with the bootstrap process.

I worked yesterday on all edge cases - changing uploads folder, changing plugins folder and did not even attempt to change wp-admin. I think we need to draw a line and decide what we can support. The possible permutations are causing issues - mostly from 'extern' calls and when the CMS is not boostrapped.

  • Lastly we are assuming WP is not bootstrapped - hence why I want the values defined in the civicrm.settings.php file. Tim's civicrm.config.php can find the settings file and we need those paths for the bootsrap process.

Perhaps I am getting 'testing blind' over this - so if you see a way to improve that would be great.

@christianwach
Copy link
Member

we are assuming WP is not bootstrapped

@kcristiano thanks for clarifying. If that's the case, then my only request would be for more documentation - I'm unclear where the various constants are set (or could be set) so it would be really helpful to leave some breadcrumbs for developers in the respective method docblocks.

Cheers, Christian

@kcristiano
Copy link
Member Author

@christianwach added a docblock - I also updated https://wiki.civicrm.org/confluence/display/CRM/WordPress+installed+in+its+own+directory+issues with all the testing I have done.

The next step is fixing the installer to handle this and more testing. We will need to update README.md and readme.txt to cover these changes.

@alifrumin
Copy link

I tested this and it worked for me!

@kcristiano
Copy link
Member Author

jenkins test this please

@kcristiano
Copy link
Member Author

civicrm/civicrm-core#10214 is dependent on this PR

@kcristiano
Copy link
Member Author

@totten tested and merged your improvements. Works fine. Would like this in early in an RC cycle to get more eyes/hands on the rela world testing.

@kcristiano
Copy link
Member Author

civicrm/civicrm-core#11031 is now the matching PR in civicrm-core

@kcristiano kcristiano changed the title CRM-16421 CRM-17633 WIP Changes to support WP in it's own directory … CRM-17633 WIP Changes to support WP in it's own directory … Sep 27, 2017
@alifrumin
Copy link

I tested this pr and civicrm/civicrm-core#11031 on a wordpress install with wordpress in the root site directory and with wordpress in its own directory and did not get any issues regarding directories or resource urls.

@eileenmcnaughton
Copy link
Contributor

Merging per related PR #11031

@eileenmcnaughton eileenmcnaughton merged commit eda0381 into civicrm:master Oct 2, 2017
@kcristiano kcristiano deleted the 17663r branch November 11, 2019 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants