-
Posts
6,264 -
Joined
-
Last visited
-
Days Won
314
Everything posted by bernhard
-
Payment related Project, opinions, hints, all much appreciated
bernhard replied to olafgleba's topic in General Support
Sad to hear that @olafgleba Did they find a wordpress plugin for it? *scnr Jokes aside I'd be very curious to hear that oddity if it's nothing secret ? -
Great stuff, @ryan! Would you mind sharing how you measure those performance related things and maybe more importantly how you classify these results. I mean ... I guess you use ProfilerPro for the measuring, but what if, let's say a module that I'm developing adds 3ms penalty due to whatever. Is that what you'd call "a little bit of a performance hit" or would that mean 10ms or maybe 100?
-
Thx! Ok if you prefer that I'll do single threads ?
-
Thx @adrian and sorry for not providing the line numbers! The problem is on line 1330 and this fixes it for me: protected function getPHPUser($full = true) { if(function_exists('posix_geteuid') and function_exists('posix_getpwuid')) { $pwu_data = posix_getpwuid(posix_geteuid()); if($pwu_data) $username = $pwu_data['name']; } added "and function_exists ..."
-
Hey @adrian my server does not allow that function (and maybe others needed by the diagnostics panel). If you find time, would it be possible to wrap all those checks around try/catch ?
-
@Jonathan Lahijani why don't you just use a separate config-local.php where you set guestForceDevelopmentLocal = true? Such a dedicated config has a lot of other benefits like disabling sessionFingerprint to make sure you don't get logged out when you enable mobile view in devtools or filesOnDemand when using RockMigrations:
-
Hey @adrian I don't want to mess up your dedicated forum with bug reports that might hurt in everyone's eyes so I think it's better to have a single bug report topic. At least for me. Here's the current one that I got after upgrading an old site from php 7.4 to 8.1: I tried submitting the module config page and also a cookie+modules refresh but the error is still there. Adding this to the top of findPageTemplateInCookie() fixes it: if (!$cookie) return false;
-
solved Show only page edit form, without header and footer
bernhard replied to SebastianP's topic in API & Templates
just add &modal=1 to your edit-url! You can even just show some fields: ?id=1&modal=1&fields=title,body -
Glad to hear that @Outward, thank you very much ? Yeah, go for it! RockFrontend + Livereload + Latte is an amazing combo ?
-
1st thought: Wow, that is brilliant!!! 2nd thought: We have to build a module from/for that!! 3rd thought: Hm... How would I actually use it. What fields would we need to have? Would I actually want to update, just because there are updates? Isn't it actually more dangerous to update modules than to just leave them untouched? I mean - I'm also keeping all modules up to date usually, but in general that happens during development so I'm hands on that project and I instantly see if something breaks. So how are you thinking to use that @wbmnfktr and others? I'm also happy to read about RockMigrations, though I wonder if the use case would be a good one for RM... It's actually built more for the opposite of reverting changes. It's really good add adding/changing things, but I'm usually reverting things just by git reset and/or "php rockshell db-restore" I really like the idea of having some kind of PW Assistant (or copilot) that notifies the admin about important things. It would be to define thought what those important things could be. I could think of several things like monitoring file count, file size, db site, file permissions etc. of an installation. Maybe also a 404 monitor or such. Maybe I'm already too many steps ahead, but I think if I really wanted to add something like this it would need to be something really useful and just updating for the sake of being up to date is just not enough for me ? Edit: Related: https://processwire.com/talk/topic/28499-automation-hooks-make-life-easier/#comment-232765
-
I'd be very surprised, but I don't know. I've never had such an issue. Did you check if the classloader is loaded before your use statement fires? Sometimes when working with migrations it might happen that some modules are loaded in a different order (because you installed them in a different point in time) and so you can end up with those kind of "... not found" issues.
-
I'm using TinyMCE and have configured it to only allow a very limited set of features: At least I thought so. Until a client copied content from the old website and I was surprised to see images in these TEXT-fields... Turns out that TinyMCE seems to allow basically any HTML in it even if the toolbar is configured differently. Does anybody know who I would - for example - set up a TinyMCE field that only allows regular text and <strong>bold</strong> text?
-
I'd try to purge cache and cookies first.
-
Hi @kongondo thx for your kind words ? Yeah it took quite long and it was really not easy to put everything that I know in a 20min talk. Obviously. That's why it took 60 ? But yeah, I wrote down all that I love about PW over some weeks and then tried to wrap everything up and tried start from scratch so that everybody understands what I'm talking about, but then also show how much power it has under the hood. Regarding the checks: We had technicians for that ?? But thx for the kudos ? Thx for the feedback! I had one guy that gave me the feedback that he found the git thing confusing. But we currently stand at 3 who said they liked it ? For me it was a good way to make sure that everything works as expected and even if I forget something I don't end up in disaster trying to find a silly bug that I introduced somewhere... Also that way I can put it on github for everybody to inspect. Same here. I never really saw the benefit. It always felt as something new to learn, with a different syntax than the one I knew for something that PHP itself can do really well. And I didn't see a lot of benefit in using {{ foo }} instead of <?= $foo ?> either. That totally changed when I saw things like this: <ul> <li n:foreach="$page->children() as $child"> {$child->title} <a n:if="$child->editable()" href="{$child->editUrl()}">edit</a> </li> </ul> I didn't mention any performance issues. But I'm not using it on any huge projects so far. Though latte states that it's extremely fast because it compiles to pure PHP (you can inspect those files in /site/assets/cache/Latte when using RockFrontend). Same here again. I was never a fan of docker (though I'm getting to know it better and start liking it I guess). I'm using it on a MacBook Air at the moment. I'm not on Windows any more. Just like docker I've never really liked mac either, but I had to use a macbook in the agency I was working and despite the hassle that came with switching keyboard layout etc. it was actually a really good experience. I fell in love with the absolutely zero noise level. No fans at all. Never. Not the slightest noise unless it has to output some audio. Really great. Also battery life is great. It's a new experience for me to just grab the device without really thinking about if the battery will last long enough in meetings. It will. DDEV was also one of the things that I "had to use" in the agency. And it's an absolutely brilliant tool so I'm still using it every day and it has helped me so much in some projects that would have been a lot of pain in the days when I was using laragon on windows. For example I'm working on a project where I need to transform PDFs in JPGs for quick and efficient previews and that's very easy to do on unix with poppler-utils. A single line of code. But on laragon+win that did not work, so I had to work around that or develop on the live system and then copy+paste things over to local to then push it back to git... Now on DDEV I can simply install poppler-utils in the web container and everything locally works just like on production. I've been using DDEV on Windows in my first month at the agency. It worked very well first, but then it got reeeeeeally slow. Not sure what was the reason though. It was a quite weak device compared to my macbook (8GB instead of 16GB ram) and with all the virtualisation that might have been too little after all. But I have the feeling that something else was going on. I've had one issue on mac as well where it was causing high cpu all the time. That went away after an update, so maybe something similar was happening on windows as well. But afterall I'm enjoying the unix system on my mac now and I found alternatives for all my programs that I've been using on windows (the only one that I'm still missing is "search everything" - so if anyone has a mac alternative for that, please let me know!). That's saving a page... fast enough for my taste ?
-
Hey @protro I've refactored RockFrontend so now you can use this: $latte = $rockfrontend->loadLatte(); It's in the latest DEV commit: https://github.com/baumrock/RockFrontend/commit/b0d1ac6b24bdf5085272d4c324db1b1f0e58fcd6 Does that work for you?
-
How to track all called $page->* properties (fields) ?
bernhard replied to ukyo's topic in General Support
I think it would help if you give us some context on why you want to do that and what the actual goal of that is. -
Hey @protro that's strange - why should it find the woff file as changed file if it didn't change? Though you can customize livereload to your needs like this: $config->livereload = [ // interval to watch for changes 'interval' => 1, // 1s = default // user defined include paths 'include' => [ '.*/foo/bar', ], // you can reset default include paths 'includeDefaults' => [], // user defined exclude regexes 'exclude' => [ '.*/site/my-ignored-folder', ], // you can reset default excludes 'excludeDefaults' => [], ]; I might exclude /site/assets entirely one day ...
-
Sounds like a bug to me and might be worth creating an issue on github? Other than that: Have you tried limiting allowed url segments via regex? Just tried with a regex that allows all url segments except ones starting with "test" and it worked: regex:^(?!test).*$ In home.php bd($input->urlSegment1); And the hook in init.php: $wire->addHookAfter("/test/{file}", function ($e) { bd($e->file); }); /foo/bar/ --> shows "foo" /test/foo.jpg --> shows "foo.jpg"
-
That's a great writeup! ?
-
If you are only handling a limited number of images you can also use RockImagePicker: https://processwire.com/talk/topic/27677-help-suggestions-on-reusing-a-background-image-across-a-site/
-
Just released v2.40.0 with some nice updates ? https://github.com/baumrock/RockFrontend/releases/tag/v2.40.0 I started to adopt a new workflow, because I often heard that "it's hard to keep track". That's why from now on I'll push updates to the dev branch and then merge them to main from time to time. The topbar now shows the current page's template, which is handy:
-
I've just released a new version with a ton of updates ? https://github.com/baumrock/RockMigrations/releases/tag/v3.25.0 I started to adopt a new workflow, because I often heard that "it's hard to keep track". That's why from now on I'll push updates to the dev branch and then merge them to main from time to time. Highlights: I improved the deployment log a lot, made everything a lot cleaner and tried to catch all the warnings that where just written to the log before. Old: New: We also have a new tweak to show page ids in the page tree (1) and a helper method to add labels in the page list (2) and also the template name (not in the screenshot) Check out https://github.com/baumrock/RockMigrations/releases/tag/v3.25.0 for all updates!
-
I'm still using class constant everywhere with great success. Another benefit is that if you remove a field during development your IDE will show you all references that have to be removed. Here I have removed the field "field_eventname" because I don't need it any more. So I removed the constant definition on top of the file and immediately I get proper warnings from the IDE:
-
The error that you are seeing comes from RockMigrations and not from get_defined_vars() - sorry for that. It has been fixed in the dev branch here already: https://github.com/baumrock/RockMigrations/commit/3ab756003e697f5fb2af0e2357094613464bd901#diff-f2f9bf51d98ac65f5b9abedff5f904a71b54b3ba563b1756756a37c5e9852635L4326 The problem was that ->getInfo()['version'] did not work anymore since I split the module info into it's own file to support PHP8 requirement. I'll merge everything into main soon ?