S.O.S I f***** up... I enabled access control for the "process" field = 503 error!
By
jonatan, in General Support
-
Recently Browsing 0 members
No registered users viewing this page.
-
Similar Content
-
By MoritzLost
Sorry for the convoluted title. I have a problem with Process modules that define a custom page using the page key through getModuleInfo (as demonstrated in this excellent tutorial by @bernhard). Those pages are created automatically when the module is installed. The problem is that the title of the page only gets set in the current language. That's not a problem if the current language (language of the superuser who is installing the module) is the default language; if it isn't, the Process page is missing a title in the default language. This has the very awkward effect that a user using the backend in the default language (or any other language) will see an empty entry in the setup menu:
This screenshot comes from my Cache Control module which includes a Process page. Now I realize the description sounds obscure, but for us it's a common setup: We a multiple bilingual sites where the default language is German and the second language is English. While the clients use the CMS in German, as a developer I prefer the English interface, so whenever I install a Process module I get this problem.
As a module author, is there a way to handle this situation? I guess it would be possible to use post-installation hooks or create the pages manually, but I very much prefer the declarative approach. The page title is already translatable (through the __ function), but of course at the time of installation there is no translation, and as far as I'm aware it's not possible to ship translations with a module so they are used automatically. Could this situation be handled better in the core? I would prefer if the module installation process would always set the title of the Process page in the default language, instead of the language of the current user. -
By MoritzLost
Process Cache Control
This module provides a simple solution to clearing all your cache layers at once, and an extensible interface to perform various cache-related actions.
The simple motivation behind this module was that I was tired of manually clearing caches in several places after deploying a change on a live site. The basic purpose of this module is a simple Clear all caches link in the Setup menu which clears out all caches, no matter where they hide. You can customize what exactly the module does through it's configuration menu:
Expire or delete all cache entries in the database, or selectively clear caches by namespace ($cache API) Clear the the template render cache. Clear out specific folders inside your site's cache directory (/site/assets/cache) Clear the ProCache page render cache (if your site is using ProCache) Refresh version strings for static assets to bust client-side browser caches (this requires some setup, see the full documentation for details). This is the basic function of the module. However, you can also add different cache management action through the API and execute them through the module's interface. For this advanced usage, the module provides:
An interface to see all available cache actions and execute them. A system log and logging output on the module page to see verify what the module is doing. A CacheControlTools class with utility functions to clear out different caches. An API to add cache actions, execute them programmatically and even modify the default action. Permission management, allowing you granular control over which user roles can execute which actions. The complete documentation can be found in the module's README.
Plans for improvements
If there is some interest in this, I plan to expand this to a more general cache management solution. I particular, I would like to add additional cache actions. Some ideas that came to mind:
Warming up the template render cache for publicly accessible pages. Removing all active user sessions. Let me know if you have more suggestions!
Links
https://github.com/MoritzLost/ProcessCacheControl ProcessCacheControl in the Module directory CHANGELOG in the repository Screenshots
-
By Macrura
This is the new topic for the Settings Factory module (formerly known as Settings Train).
Repo:
https://github.com/outflux3/SettingsFactory
I'm not sure what versions this is compatible with, it has only been tested on 3.x branch;
it is not namespaced, and i'm not sure if namespacing is necessary or a benefit for this module; if any namespace or module gurus can weigh in on this, let me know. I'm also not sure if there needs to be a minimum php version;
I have one live site using this now and it's working great; But before submitting to mods directory, would be better if there was some additional testing by other users.
-
By prestoav
Hi all,
PW: 3.0.42
I'm trying to have responsive images in the body field. First I need to stop the image tag generated by CKEditor adding the width attribute to the image tag on insertion. I found the 'Skip width attributes on image tags?' in the settings of ProcessPageEditImage and that suggests it does exactly what I'm after.
Sadly, even when this checkbox is checked and a new image is inserted the width attribute is still added.
Am I missing something?
TIA.
-
By Martin Muzatko
Hello!
I'm trying to use the data I create in Processwire as much as possible.
So for a form, I try to use the fields description, name and also its built-in validation rules I defined in ProcessWire on the front-end. (minlength, ranges, patterns, etc)
I already looked into this tutorial, but it is using external resources to validate the form.
Since ProcessWire does all the heavy lifting, when processing data, I don't have to sanitize anything - ___processInput should do the job just fine.
However, it is not actually working correctly.
$fields = $templates->get('user')->fields; $submission = $input->post; foreach ($submission as $key => $value) { $field = $fields->{$key}; if ($field instanceof Field) { $field = $field->getInputfield($user); $field->___processInput(new WireInputData([$key => $value])); var_dump($field->getErrors(true)); // retrieve validation error } } This works for some constraints, but the values are not correctly validated.
Example:
All the fields are required and zip is an integer field.
Yet, I get no validation error for zip, although it was entered as a string, and not an integer. Funny enough: if I provide a number outside the range, I get "Specified value 2 removed because it is out of bounds (min=1000, max=99999)".
firstname will not return any error for being a required field.
From what I have looked through the source code, there is no check for "required". Some fields only validate on setAttribute. Am I missing anything or am I doomed to build my own validation process?
Thank you in advance!
Best,
Martin
-