-
Posts
242 -
Joined
-
Last visited
-
Days Won
3
da² last won the day on December 7 2023
da² had the most liked content!
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
da²'s Achievements
Sr. Member (5/6)
150
Reputation
-
About using Paypal for payment, better solution than using payment buttons is to use Paypal checkout SDK. Then you can dynamically create any order you want and validate the payment. EDIT : this SDK is now deprecated and replaced by REST API.
-
Hello @HarryWilliam It looks like padloper is a e-Commerce module.
-
@hellomoto It's a common error. You are outputting data before the headers, but headers must be the first thing to output. Headers are sent by ProcessWire, but you echo something before to include PW: $boot = realpath($boot); echo $boot; // DO NOT echo something... require_once $boot;// $pw_dir.'/index.php'; // ...BEFORE PW sent headers. Also why do you use this code and not a simple include at start of file? include __DIR__ . "/../index.php";
-
Hello, Is your template named "repeater"? (I don't really understand the "page object class: RepeaterPage" here, I don't see this information on my side but am not on last PW version, I imagine this is the custom class associated with this template, but RepeaterPage is a PW class)
-
using markup regions prints content of template as text
da² replied to herr rilke's topic in General Support
Hello, The pw-replace must be in template-file.php and the id in _main.php. Documentation. -
New blog post: ProcessWire invoices application site profile
da² replied to ryan's topic in News & Announcements
Nice, for a beginner it's a nice way to quickly discover PW mechanics. And probably an experimented user can also find some interesting features he doesn't already know (I already see some of them). 🙂 -
On my side I use a script to upload site, there's 2 parts: - A Ant project that synchronizes some folders/files from the source code to a "target" directory, add a version number and transpile SCSS to CSS, TypeScript to JS... - A bash script that runs the Ant project, and if no error, use rsync to synchronize only changed files with the production server. It uses a file listing exclusions so I'm sure the site/config.php will never be uploaded, like the sessions or the cache. This script is a Linux one because Linux have those powerful integrated tools like rsync, but I'm running Windows and executing the script with Microsoft Linux WSL. I have another bash script for staging server, it's the same as for production except it also pushes a clean version of my local ProcessWire database to the staging server.
-
You can do it with a module or manually. https://processwire.com/modules/process-wire-upgrade/ https://processwire.com/docs/start/install/upgrade/
-
Hello, updating PHP means you need to install a newer version of PHP, it's not directly related to ProcessWire in first instance. It depends of your OS (Windows, Linux), it also depends if this is a shared host or a dedicated server. In a shared host you usually have an administration interface provided by your hosting service to manage your server. In a dedicated server you generally do everything yourself. About ProcessWire you have to check that the currently installed version is compatible with the PHP version you plan to install. Probably it won't be OK because you talk about years. If you plan to install PHP 8+ you'll also need to upgrade PW.
-
Responsive ProfieldTable (field type) in UiKit-AdminTheme ?
da² replied to August's topic in Themes and Profiles
@August I use PhpStorm, in my commit window I just have to right click a file or a set of files, and create patch: Of course you can do the same with vanilla git tools, by command line or probably with Git GUI. -
Responsive ProfieldTable (field type) in UiKit-AdminTheme ?
da² replied to August's topic in Themes and Profiles
@August Because I'm using big tables that are filled dynamically and locked in admin and the result is a horizontal scrollbar on the whole page: In that case I create a git patch file, so if I update PW to a version that doesn't fix the issue, I then apply the patch. I also document on my wiki what's the goal of each patch. -
Responsive ProfieldTable (field type) in UiKit-AdminTheme ?
da² replied to August's topic in Themes and Profiles
Hello @August Maybe you can add your suggestion to my issue report. -
How to show the custom error message below the Inputfileds?
da² replied to SIERRA's topic in General Support
If you look into InputfieldRepeater.module, in method ___processInput() : if($numErrors || $numRequiredEmpty) { $this->error(sprintf($this->_('Errors in “%s” item %d'), $this->label, $key + 1)); if(!$page->hasStatus(Page::statusUnpublished)) $this->numRequiredEmpty += $numRequiredEmpty; $openIDs[$page->id] = $page->id; // force item with error to be open on next request } else if(isset($openIDs[$page->id])) { unset($openIDs[$page->id]); } It opens items with an error, but our hook is executed after this, so this code doesn't know at this time that this item has an error (and "before" hook is not working at all). You see that $openIDs is used to remember which items to open, and at bottom of this function it stores it in session: if($_openIDs !== $openIDs) $this->wire()->session->setFor($this, 'openIDs', $openIDs); So it looks like there's at least a way to achieve your goal by directly updating this session variable: wire()->addHookAfter("Inputfield(name=championshipRoundRepeater)::processInput", function (HookEvent $event) { /** @var InputfieldRepeater $inputfieldRepeater */ $inputfieldRepeater = $event->object; $openIDs = wire()->session->getFor($inputfieldRepeater, 'openIDs') ?? []; /** @var InputfieldWrapper $wrapper */ foreach ($inputfieldRepeater->getWrappers() as $repeaterItemId => $wrapper) { /** @var Inputfield $itemField */ $itemField = $wrapper->getByName("title_repeater$repeaterItemId"); $itemField->error('this is an error'); $openIDs[$repeaterItemId] = $repeaterItemId; } wire()->session->setFor($inputfieldRepeater, 'openIDs', $openIDs); }); I don't like this solution because it is strongly dependent of a the ___processInput() private implementation. Maybe there's a cleaner way to work with this, I don't know... If no, maybe it would be a good idea to add a hookable method ___checkForItemErrors(InputfieldWrapper $repeaterItem):void, called from ___processInput()? @ryan -
How to show the custom error message below the Inputfileds?
da² replied to SIERRA's topic in General Support
I don't how to do this, but by exploring HTML source of the repeater items in admin page (browser dev tools), looking InputfieldWrapper API and InputfieldRepeater API, and var_dumping things in a hook, I found a way. self::addHookAfter("Inputfield(name=championshipRoundRepeater)::processInput", function (HookEvent $event) { /** @var InputfieldRepeater $inputfieldRepeater */ $inputfieldRepeater = $event->object; /** @var InputfieldWrapper $wrapper */ foreach ($inputfieldRepeater->getWrappers() as $repeaterItemId => $wrapper) { /** @var Inputfield $itemField */ $itemField = $wrapper->getByName("title_repeater$repeaterItemId"); $itemField->error('this is an error'); } });