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#1651 and dev/core#1637 - Inline editing not working on admin screens and other js packages issues #16780

Closed
wants to merge 1 commit into from

Conversation

demeritcowboy
Copy link
Contributor

Alternate to #16779

@civibot
Copy link

civibot bot commented Mar 15, 2020

(Standard links)

@civibot civibot bot added the 5.24 label Mar 15, 2020
@kcristiano
Copy link
Member

@demeritcowboy if I apply this PR and #16779 I get failures on inline editing (Financial Types) as well as adding images in the traditional mailer.

This PR seems to change the URL to http://wpcvrc.test/[civicrm.packages]/kcfinder/browse.php?cms=civicrm&type=images&CKEditor=crmUiId_1&CKEditorFuncNum=0&langCode=en

With just #16779 it works fine

@demeritcowboy
Copy link
Contributor Author

You would only apply one PR. This is an alternate to 16779 - I think this is better, but either one, alone, work.

@demeritcowboy
Copy link
Contributor Author

demeritcowboy commented Mar 15, 2020

Or maybe on wordpress the /. does something? (in the first changed line)

@kcristiano
Copy link
Member

kcristiano commented Mar 15, 2020

Or maybe on wordpress the /. does something?

It should not.

I see I applied both thinking we needed to fix i10n.js

I'll try with just this PR

@kcristiano
Copy link
Member

I rebuilt D7 and WP with just this PR and I consistently get failures as noted above.

#16779 does work properly. I'd recommend merging #16779

@demeritcowboy
Copy link
Contributor Author

Weird. I was sure I tested it. I might have done it on master and maybe different there. Thanks.

@seamuslee001
Copy link
Contributor

closing in favour of #16779

@demeritcowboy
Copy link
Contributor Author

Cool. I was curious - I must have had some caching or something. So this is in master:

# No slash, no dot
cv ev "echo Civi::paths()->getUrl('[civicrm.packages]');"
# doesn't recognize it
http://site/[civicrm.packages]

# With a slash
cv ev "echo Civi::paths()->getUrl('[civicrm.packages]/');"
# Result has a slash
http://site/sites/all/modules/civicrm/packages/

# With a slash and dot
cv ev "echo Civi::paths()->getUrl('[civicrm.packages]/.');"
# result is no slash
http://site/sites/all/modules/civicrm/packages

So it's possible to make it work but could look at doing that in master.

@demeritcowboy demeritcowboy deleted the inline-edit2 branch March 15, 2020 19:58
@totten
Copy link
Member

totten commented Mar 15, 2020

@demeritcowboy Yup, that's what I see too.

Short version: IMHO, it's a flaw in getPath() / getUrl(). We should patch them to support bare-variables and expand Civi\Core\PathsTest to include that test-case (in addition the existing ones). Agree that should be fixed in master.

Long version: I've filed it as a separate issue https://lab.civicrm.org/dev/core/issues/1653

@@ -13,7 +13,8 @@
// Config settings
CRM.config.userFramework = {$config->userFramework|@json_encode};
CRM.config.resourceBase = {$config->userFrameworkResourceURL|@json_encode};
CRM.config.packagesBase = {capture assign=packagesBase}{crmResURL expr='[civicrm.packages]/.'}{/capture}{$packagesBase|@json_encode};
CRM.config.packagesBase = {capture assign=packagesBase}{crmResURL expr='[civicrm.packages]'}{/capture}{$packagesBase|@json_encode};
CRM.config.packagesBase = CRM.config.packagesBase.replace(/\/+$/, '') + '/';
Copy link
Member

Choose a reason for hiding this comment

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

Stylistically, I like this patch better than #16779, but yeah - as you found, the [civicrm.packages] doesn't evaluate as expected.

Since the output before was expected to end in a trailing slash, I can't help thinking that this might have been a one-character patch - just changing /. to /.

Copy link
Contributor Author

@demeritcowboy demeritcowboy Mar 16, 2020

Choose a reason for hiding this comment

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

Yeah it's unfortunate I had some local issue/operator error that made it seem like it worked at first. I think for the regression though at this point it was more about not making everyone test/review things again on all cms's.

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