-
Posts
6,670 -
Joined
-
Last visited
-
Days Won
366
Everything posted by bernhard
-
Hey @adrian this is a bit special, but maybe it's an easy fix, I don't know π I love these direct IDE links in dumps that open up the file in question right in my IDE when clicked: The problem is that @Sanyaissues and I have been working on improving RockMigrations deployments and Michael also suggested to put all PW files into /public This leads to a folder structure like this: /Users/bernhard/projectx /public /site /wire /src foo.latte bar.latte When I set localRootPath to /Users/bernhard/projectx/public/ links for files inside the PW root work (eg /site/ready.php) BUT links for files to /src/foo.latte do not π I have all my latte files outside of /public. Also all assets (css/js) are in the /src folder and then compiled, merged and minified via RockDevTools to /public/dst I was hesitant to go with such a setup at first because I was expecting issues. I already had to refactor my modules to support that setup and there are likely some spots still to fix. But I think it is a great setup and it is worth the effort. What do you think? Is that something you could support for tracy debugger as well? Maybe it's just do add a new (optional) setting like "projectRoot" so that paths to can properly be rewritten: /var/www/html/src/foo.latte /Users/bernhard/projectx/src/foo.latte /var/www/html/public/site/ready.php /Users/bernhard/projectx/public/site/ready.php At the moment the result is this: /var/www/html/src/foo.latte /var/www/html/src/foo.latte /var/www/html/public/site/ready.php /Users/bernhard/projectx/public/site/ready.php I guess it's because it does not find $config->paths->root in the filename and thus does not apply a str_replace? Thx a lot in advance π
-
Hey @Spinbox I have just added support for showIf also checking other form fields on the block (not only other settings) and it now supports complex conditions like these: 'showIf' => 'advancedOptions=1 && (layout=grid || layout=list)', 'showIf' => 'whatever=1 || text="foo bar"', https://www.baumrock.com/en/processwire/modules/rockpagebuilder/docs/settings/#conditionals-showif
-
[solved] RockForms nette RadioList Control Renderer
bernhard replied to Jochen Fritsch's topic in Module/Plugin Development
Ok I still don't understand but here you go: $f = $form->addRadioList('demo', 'Demo', [ 'foo' => 'Foo Option', 'bar' => 'Bar Option', ]); $form->rockforms()->hookField(function (HtmlPageCrawler $field) { // $field->outerHtml() is the whole field pair (label + input + errors) // find all defined <label> elements $field->filter('label')->each(function (HtmlPageCrawler $label) { // $label->html() is something like this: // <label><input type="radio" name="demo" value="foo">Foo Option</label> // get <input> element $input = $label->filter('input')->first(); // no input found (this is the field pair label) if (!$input->count()) return; // get input html $inputHtml = $input->outerHtml(); // remove input and get remaining inner html $input->remove(); $rest = $label->html(); $label->replaceWith("$rest - whatever - $inputHtml"); }); }, $f); Unfortunately Nette is quite complicated when it comes to modifying markup. You could write a custom renderer, but that's also not so easy. That's why I have built the hookField helper that uses RockFrontend's dom tools to do whatever markup manipulation you need. For simpler use cases (eg displaying two fields side by side) check out the addMarkup() helper: $form->addMarkup("<div class='uk-flex'>{field1} {field2}</div>"); Since you need to change the inner markup structure of the field it is a bit more complex in your scenario π -
[solved] RockForms nette RadioList Control Renderer
bernhard replied to Jochen Fritsch's topic in Module/Plugin Development
Hey @Jochen Fritsch there are several ways to achieve this, but may I ask WHY you want to do that? There are reasons for it having this markup. AI Quote: -
Hey @Hackasacka I'm happy to announce that RockCommerce v1.4.0 supports custom payment providers via a very simple interface: <?php namespace RockCommerce; interface PaymentProvider { public function getPayment(string $id): Payment|false; public function createPayment(Order $order, array $data = []): Payment|false; } Please check out the new docs: https://www.baumrock.com/en/processwire/modules/rockcommerce/docs/payment-providers/
-
Hi @elvina sounds like your user does not have the alfred permission:
-
Hey @FireWire just wanted to let you know that the "Click To Translate All" feature bit me in my ** today π It would be great to have an "Click To Translate All Empty" option, because I had the UI open like this: So I clicked "translate all" and boom both fields have been translated. I thought. But actually it also translated some of my other 57 fields on that page and I didn't realise! This can be a quite destructive operation, so it would be great if you could prioritise this issue if possible π Thx a lot! PS: I wanted to provide a PR as the task seemed quite simple but Fluency has some quite complex JS setup that I don't understand and that involves a lot of tools I'm not using (babel/gulp) π€―π
- 315 replies
-
- 2
-
-
-
- translation
- language
-
(and 1 more)
Tagged with:
-
Cool, thx! I've just pushed your suggested fix and it will be available soon as v1.3.2 π
-
This is not a specific request and might be no issue, just sharing what I observed and asking if that's maybe something that can easily be improved? Today I got a dump like this for my ajax request: This is the url hook used: wire()->addHook('/test/', function () { bd('test!'); return true; }); And this is how I fired the request in the devtools: fetch('/test'); note that I'm using "/test" as url (without a trailing slash). If I use the correct url the dump works as expected. Now obviously this is not a bug on tracys side, but I'm wondering if tracy can do anything about that? This is how the request looks in the debug bar: As you can see there are two requests, which makes sense, but if there are two requests shouldn't the second one have the correct dump? Or could it somehow show a warning that a wrong endpoint has been used to make it more obvious not to forget about trailing slash yes/no?
-
PS: The "Flipper" feature has been possible before quite easily as well, but it got a lot nicer today!! --- code necessary for flipper buttons before today --- // year buttons RockGrid.on("button:year", (button) => { // set headerfilter of day column to // current date in format yyyy // reset all other columns filters table.clearHeaderFilter(); table.setHeaderFilterValue("day", luxon.DateTime.local().toFormat("yyyy")); }); RockGrid.on("button:prevyear", (button) => { // get current header filter of day column const filter = table.getHeaderFilterValue("day"); const year = filter ? luxon.DateTime.fromFormat(filter, "yyyy") : luxon.DateTime.local(); // set header filter to previous year table.clearHeaderFilter(); table.setHeaderFilterValue( "day", year.minus({ years: 1 }).toFormat("yyyy") ); }); RockGrid.on("button:nextyear", (button) => { // get current header filter of day column const filter = table.getHeaderFilterValue("day"); const year = filter ? luxon.DateTime.fromFormat(filter, "yyyy") : luxon.DateTime.local(); // set header filter to next year table.clearHeaderFilter(); table.setHeaderFilterValue("day", year.plus({ years: 1 }).toFormat("yyyy")); }); --- code as of today --- <span rg-flipper="field:date;range:year;">Y</span> <span rg-flipper="field:date;range:month;">M</span> <span rg-flipper="field:date;range:day;">D</span> So cool ππ
-
RockGrid has seen a lot of great improvements over the last few days π The whole codebase has been cleaned up and all javascript files have been split into several files to make maintenance easier. All of that was easily possible thanks to RockDevTools. RockGrid now supports so called "magic attributes" that can pull data from the grid and create UI elements completely automatic. TagsFilter The new tags filter pulls data from one column of your grid and lists all available options as clickable filter tags: All you have to do: <div rg-tagsfilter="field:your_field_name;"></div> --- Flipper I realised that when building grids for my custom bookkeeping software I built the same stuff over and over again, for example buttons to quickly flip over time periods (like the current year, previous year, this month, previous month, etc...). Now that's also built into RockGrid and can be used with a single dom attribute! π All you have to do: <div rg-flipper="field:date_column;range:year;">Y</div> <div rg-flipper="field:date_column;range:month;">M</div> <div rg-flipper="field:date_column;range:day;">D</div> Go and check out RockGrid v1.6.0 ππ
-
Here we go!!! https://github.com/processwire/processwire/pull/322 Fingers crossed π€ππ
-
Cache Status for ProCache not migrated correctly
bernhard replied to gebeer's topic in RockMigrations
Hey @gebeer unfortunately these migration properties do not work 100%. They work most of the time but not always. The code field and shift-click feature are supposed to be helpers, but you always have to confirm that it works. Some props can be used as they are, some props need transformers in RM and already have them and some might be missing. If you find any we might add an exception to the getCode() method or maybe somewhere else, I'm not 100% sure atm: https://github.com/baumrock/RockMigrations/blob/883b9e8f3bed37728fa1666514ae22042344681f/RockMigrations.module.php#L1852- 1 reply
-
- 1
-
-
Sounds terrible! Surprisingly they have quite good ratings here https://www.wpbeginner.com/hosting/wpengine/ and here https://www.trustpilot.com/review/wpengine.com
-
@marie.mdna @kongondo I have just indexed PWCommerce as Deepwiki: https://deepwiki.com/kongondo/ProcessWireCommerce Maybe it helps. Maybe it's crap. I don't know π
-
Regarding using nginx I want to mention that if any module you are using relies on .htaccess (which many of my modules do) you'll have to make sure that these rules also apply to your system. For example in my RockInvoice module I protect all generated invoices in their related folder (eg /site/assets/files/123) with an .htaccess file like this: <FilesMatch ".*"> <IfModule mod_authz_core.c> Require all denied </IfModule> <IfModule !mod_authz_core.c> Order deny,allow Deny from all </IfModule> </FilesMatch> Which means, as far as I understand, that on nginx systems the invoices would be publicly available if someone knew the path, right?
-
This is really neat and I'm not sure why I didn't have that idea earlier! The filesOnDemand feature now supports callbacks!! ππ From the docs: Callback Feature Sometimes you want to prevent the filesOnDemand feature to kick in. For example in the RockInvoice module I have a pdf field that stores invoices, but these invoices are protected from direct download by htaccess. When I develop locally this leads to time consuming page requests and HTTP error messages that the requested file could not be downloaded. Callbacks to the rescue! $config->filesOnDemand = function (Pagefile $file) { if ($file->field->name === RockInvoice::field_pdfs) return false; return 'https://my-live-site.com/'; };
-
Module or field to display articles in categories
bernhard replied to kaz's topic in Getting Started
Your question is very vague. Are you talking about a blog with some kind of tagging feature? Is the challenge the backend implementation or the frontend? Or both? What "did not work" with your approach of using ListerPro / radio select. The more context you give us the better we can help. For tagging the TextTags module can be a great choice. It's imho a bit cumbersome to setup but once you got it setup its great for such use cases: https://processwire.com/blog/posts/pw-3.0.177/ -
no site configuration or install.php available
bernhard replied to DevCat's topic in General Support
In my case when updating an ancient site today the issue was that I had this line in my config.php: include('../files/config.php'); This file did exist on my remote server but not on my local DDEV setup. Changing this to my "new" setup from 2018/2022 fixed the issue π