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

Remove index from non cacheable Form action #15

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

houmark
Copy link

@houmark houmark commented Oct 8, 2017

Hey there,

First sorry for what could looked like a messy commit history. Didn't get this one started off in a branch, but the change is a one liner so I hope it's cool.

I'm not 100% sure if there's some downside with this but after trying various things, the was the only thing that worked.

Situation:

We run a signup form on all pages on the site creating the form using TS so we can show it in the footer and as a popover in some page views:

lib.footerMailChimp = USER
lib.footerMailChimp {
  userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
  pluginName = Registration
  extensionName = Mailchimp
  vendorName = Sup7even
  controller = Form
  settings =< plugin.tx_mailchimp.settings
  view =< plugin.tx_mailchimp.view
  view.templateRootPaths.1 = path/to/our/template/mailchimp/Footer/Templates/
  view.layoutRootPaths.1 = path/to/our/template/mailchimp/Footer/Layouts/
}

After moving to a new platform that includes Varnish caching, we noticed that all pages were missing the cache and so a USER_INT must be in play. Revising everything it turns out that the form is being created as USER_INT for some reason I don't understand.

Seems like there's no reason for that and so this PR is to remove it from the configurePlugin, as it will then render as a USER object.

If there's another way to force it as a USER without changing this, please let me know but I did some tests and it looks like the form works just fine (both with and without AJAX enabled) running as USER.

@georgringer
Copy link
Collaborator

It must be not cached as it also shows the errors if not filled correctly. If you are using it with ajax, I would propose to create a custom action which does the form

@houmark
Copy link
Author

houmark commented Oct 9, 2017

mmm, okay, can you point in the direction in making a custom action? I was considering that and since I use it with AJAX all places it does show the error message correctly. Would it not be possible to switch to no cached if AJAX is not enabled?

@Tuurlijk
Copy link
Contributor

@houmark you could make that an extension configuration setting. And then define the plugin actions based on that setting.

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.

3 participants