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: Changes to support WP in it's own directory. #11031

Merged
merged 1 commit into from
Oct 2, 2017

Conversation

kcristiano
Copy link
Member

Overview

Allow for civicrn.settings.extra.php for WP. Create template for civicrm.settings.extra.php. Update install/civicrm.php for all needed params for different common install scenarios. Fix linting issues in civicrm.php.

CRM 16421 CRM 17633 - update CRM_Utils_System_WordPress to allow for common install configurations

Replaces #10214
Before

WP install will fail if not installed in tyhe webroot. This supports https://wiki.civicrm.org/confluence/display/CRM/WordPress+installed+in+its+own+directory+issues

https://issues.civicrm.org/jira/browse/CRM-17633

After

Create civicrm.setting.phpo file based on WP directory structure in use

Comments

This is a rebase of the prior PR. Mertges 2 weeks ago had broken the original

Depends on civicrm/civicrm-wordpress#105

@kcristiano
Copy link
Member Author

jenkins test this please

@eileenmcnaughton
Copy link
Contributor

Jenkins:

[GitScan\Exception\ProcessErrorException]
Process failed:
[[ COMMAND: git apply --check --ignore-whitespace ]]
[[ CWD: /home/jenkins/buildkit/build/core-11031-813e8/sites/all/modules/civicrm ]]
[[ EXIT CODE: 1 ]]
[[ STDOUT ]]
[[ STDERR ]]
error: patch failed: templates/CRM/common/civicrm.settings.php.template:28
error: templates/CRM/common/civicrm.settings.php.template: patch does not apply

@kcristiano kcristiano changed the title CRM16421 CRM 17633: Changes to support WP in it's own directory. CRM-17633: Changes to support WP in it's own directory. Sep 27, 2017
…w for civicrn.settings.extra.php for WP. Create template for civicrm.settings.extra.php. Update install/civicrm.php for all needed params for different common install scenarios. Fix linting issues in civicrm.php.

CRM 16421 CRM 17633 - update CRM_Utils_System_WordPress to allow for common install configurations

CRM-16421 - Convert constants to `$civicrm_paths`

Following up on the discussion from
[civicrm#10513](civicrm#10513), this converts
the proposed constants `CIVICRM_UF_WP_BASEURL` and `CIVICRM_UF_ADMINURL` to
variables in the `Paths` system.

A few benefits:
 * Reduces code duplication between `civicrm.php` and `WordPress.php`.
 * Can construct sub-paths with prettier notation (`Civi::paths()->getUrl('[wp.frontend]/foo.txt')`)
 * Has options to output relative or absolute URLs
 * Can expand on `Paths` to provide more inspection/validation

Notes:

 * `CIVICRM_UF_WP_BASEURL` => `wp.frontend.base`
 * `CIVICRM_UF_ADMINURL` => `wp.backend.base`

----------------------------------------
* CRM-16421: Work to get CiviCRM for WordPress in WordPress' official Repository
  https://issues.civicrm.org/jira/browse/CRM-16421

CRM-16421 - Assimilate `civicrm.settings.extra.php` into `civicrm.settings.php`

----------------------------------------
* CRM-16421: Work to get CiviCRM for WordPress in WordPress' official Repository
  https://issues.civicrm.org/jira/browse/CRM-16421

CRM-17633 merge current master changes to civicrm.settings.php.template
@kcristiano
Copy link
Member Author

@civicrm-builder retest this please

1 similar comment
@kcristiano
Copy link
Member Author

@civicrm-builder retest this please

@alifrumin
Copy link
Contributor

I tested this pr and civicrm/civicrm-wordpress#105 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

test this please

@kcristiano
Copy link
Member Author

@civicrm-builder test this please

@kcristiano
Copy link
Member Author

kcristiano commented Sep 29, 2017

@eileenmcnaughton I am getting:

CRM_Utils_GeocodeTest::testStateProvinceFormat
Failed asserting that false is true.

/home/jenkins/buildkit/build/core-11031-85il8/sites/all/modules/civicrm/tests/phpunit/CRM/Utils/GeocodeTest.php:19
/home/jenkins/buildkit/build/core-11031-85il8/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:184
/home/jenkins/buildkit/bin/phpunit4:545

Do you know if there are issues with Jenkins? I can't imagine how these changes would trigger a failure there. These are all specific to the installer and only in the WP context. I was hoping to finally get these in for 4.7.26-rc testing as the best testing for the installer is via tarballs.

@MegaphoneJon
Copy link
Contributor

@kcristiano It's most likely the issue discussed yesterday here: https://chat.civicrm.org/civicrm/pl/51tgxt8zajy3mjrcub69d5nnze

@kcristiano
Copy link
Member Author

retest this please

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

@kcristiano tests are passing now & @alifrumin has tested. Code looks good.

I feel comfortable that there is no impact outside WP dirs - giving this merge-ready in the hope @christianwach will take a look & confirm he is good with this but not sure it needs to be blocked on that given the input already given

@kcristiano
Copy link
Member Author

Thanks @eileenmcnaughton Can we also mark civicrm/civicrm-wordpress#105 this one as well? Thye are related and my hope is to get these in the next RC. As they affect the installer, the RC is a perfect way to validate my testing.

@eileenmcnaughton
Copy link
Contributor

hmm - we don't have those labels on that repo

);
})
->register('wp.backend.base', function () {
return array('url' => CIVICRM_UF_BASEURL . 'wp-admin/');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kcristiano Are you sure that wp-admin/ should be hard-coded here? The admin_url filter allows this to be overridden, so if this path has to be correct without bootstrapping WordPress, then perhaps there needs to be a setting for it somewhere? OTOH, perhaps I'm raising an issue that's outside the scope of this PR.

Copy link
Member Author

@kcristiano kcristiano Oct 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@christianwach I see the point and had originally done that. In one of the iterations (this PR in various forms dates back to Ft Collins Sprint in June 2016), @totten made the followimng PRs that have been added: kcristiano@48c4fe6 and kcristiano@8b0c250 This section kcristiano@8b0c250#diff-46f9229e858ccffc107ef60a91809c43L286 removed the call to admin_url(). I attempted to add back, but had errors depending on the WP configuration.

As I would much rather have this in and then improve than hold it back even longer, I consider switching to admin_url() as a TODO. We can create an issue for that and fix it after these changes are tested through an RC. As this is an installer patch and it affects both civicrm-core and civicrm-wordpress we'll get more testing once it hits RC.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kcristiano Gotcha. Seems like a good idea.

@eileenmcnaughton
Copy link
Contributor

Ok - I think gotcha translates to 'yes this is ready to merge IMHO' - merging this & the packages one to hit the rc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
master 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.

6 participants