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

Do not render shortcodes in PUT, POST or DELETE #130

Merged
merged 1 commit into from
Jun 13, 2018

Conversation

bastienho
Copy link
Contributor

Overview

A correction for #129
Do not render shortcodes in REST context for PUT, POST and DELETE methods

Before

REST calls (eg: in gutenberg editor) using PUT, POST or DELETE methods are resulting on an exception.

After

Shortcode is returned unrendered, as it.

Technical details

The exception is provided by CRM_Core_Controller

Comments

WordPress REST API output contain both rendered and raw content, so it seems to be cleaner to render the shortcode.

It would be nicer to update CiviCRM core in order to hook into CRM_Core_Controller to let adding page_arguments[ignoreKey]=true in request args.

Forcing ignoreKey to true correctly renders the shortcode.

@kcristiano
Copy link
Member

@bastienho Can you look at the conflicts in this file? Perhaps rebase so we can move this forward?

@kcristiano
Copy link
Member

kcristiano@243a11b is rebased against master. The code looks good, you have limited where it is being called and testing it has caused no errors for me.

@kcristiano
Copy link
Member

@haystack Any objections to the latest PR? I would like to gte this in early in the RC cycle and I believe 5.3-RC is about a week away

I have been testing against master and it works well.

@kcristiano
Copy link
Member

@christianwach Can you add your review on this I have moved this patch to productionon our 5.x sites and have had good results, I'd like to see this in sooner rather than later

cc @eileenmcnaughton

@christianwach
Copy link
Member

@kcristiano Looks okay to me

@christianwach
Copy link
Member

@bastienho Could you squash these commits into a single one please?

@bastienho bastienho force-pushed the master branch 2 times, most recently from 52f14da to 46d7f7d Compare June 12, 2018 12:22
@bastienho
Copy link
Contributor Author

@christianwach done.

@eileenmcnaughton
Copy link
Contributor

@christianwach @kcristiano shall I merge?

@kcristiano
Copy link
Member

@eileenmcnaughton yes please and thank you

@eileenmcnaughton eileenmcnaughton merged commit 0e209a4 into civicrm:master Jun 13, 2018
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.

5 participants