Leaderboard
Popular Content
Showing content with the highest reputation on 07/20/2023 in all areas
-
When I modify a module that exists in the modules directory I put my initials in the module title or summary as a reminder, e.g. "Some Module: RPS mod". Then I disable the download button and add a notice to the "Download and Update" form just in case I forget. $wire->addHookAfter('ProcessModule::buildDownloadConfirmForm', function(HookEvent $event) { $data = $event->arguments(0); /* @var InputfieldForm $form */ $form = $event->return; $modules = $event->wire()->modules; // Return early if the module isn't already installed if(!$modules->isInstalled($data['class_name'])) return; // Get info about the installed module $info = $modules->getModuleInfoVerbose($data['class_name']); // Return early if special string doesn't occur in the title or summary if(strpos($info['title'], 'RPS mod') === false && strpos($info['summary'], 'RPS mod') === false) return; // Disable download button and add warning notice $update_button = $form->getChildByName('godownload'); if($update_button) { $update_button->value = 'Update disabled (RPS custom mod)'; $update_button->attr('style', 'opacity:0.5;'); $update_button->attr('disabled', 'disabled'); $this->warning('Module has custom RPS modifications: update disabled'); } $event->return = $form;7 points
-
You want to use RecordRTC.js, you will find a lot of demos and code there: https://www.webrtc-experiment.com/RecordRTC/3 points
-
No idea. But recently I watched a video that might work for you?!3 points
-
I tried a few CMS: started with Joomla then some MODX, Grav but stuck with Drupal/BackdropCMS for some time. What I liked about Drupal on which I built quite a few websites, was that it was robust and flexible enough. It was easy to get the thing done fast because it provided many modules and hooking templates for fine tuning which was great at that time. That was okay until Drupal 7. Then with Drupal 8 they lost me. I had all of a sudden no idea what was going on and how to do anything. I started to completely rely on modules and could not code on my own. I am not into OOP which I think Drupal 8 migreated to. I was looking for an alternative and settled with ProcessWire. Since then, I am totally happy as I am able to create a simple website within a few hours, which was unlikely to be the case with Drupal of whatever version. The downsides of Drupal I found while using it are: it was way too heavy; even basic functionalities were module-based; it was slow; it had high resource consumption. To sum it up, even if Drupal was back to 7 where I left it, I would not go back. It was great at that time but I moved on.2 points
-
The question is: is $event->return already null when your hook is entered? If yes, the problem happens earlier.2 points
-
2 points
-
Hey @David Karich. No, nothing new I am afraid. A few unrelated stuff came up that I have had to focus on. This should be over in the next 2-3 weeks after which I'll resume the work on MM.2 points
-
@eutervogel I corrected that for you. And there's nothing to be sorry about ?2 points
-
As requested by @fuzenco (quite a while ago... sorry for being slow), I'm just creating a separate thread for our TextFormatterLiteVideoEmbed module rather than hijacking the Lite YouTube Embed Module thread. TextFormatterLiteVideoEmbed is a text formatter that replaces YouTube and Vimeo urls in text and textarea fields with custom web components that only load the video iframe when they've been interacted with. This is a million (approximately) times faster than loading the video when the page loads, especially if you have multiple videos on a page. You can check Paul Irish's original YouTube version to see what it's all about. There are config options to set the button colours for the components, and one day I'll get round to adding all the other parameters we ought to have. I've used it on several live sites at the moment and is our go-to module for embedding videos now so hopefully will keep adding to it but I'm happy to take requests if anyone needs anything specific adding. It was originally based on the TextformatterLiteYouTubeEmbed module so props to @jacmaesfor creating that. The code is available on Github at https://github.com/millipedia/TextformatterLiteVideoEmbed and I'll add it to the modules repository once I've tidied up the code (it's getting there slowly).1 point
-
I have a new favourite alias ? function rockshell() { ddev exec php rock "$1" } WHY? RockShell needs to be run from within the DDEV web container. So usually you'd either ssh into the container and then run "php rock ..." or you'd have to use the command "ddev exec php rock ..." With this alias all you need to do is type "rockshell ..." ? Or don't add any command and you'll get the list of all RockShell commands: Here are all current aliases that I use: # ddev aliases alias ddc='ddev config --php-version=8.1 --database=mariadb:10.6 --webserver-type=apache-fpm --timezone=Europe/Vienna --omit-containers=dba' alias dds='ddev ssh && alias ll="ls -alh"' #alias dd='ddev start && ddev launch && ddev auth ssh -d ~/.ssh/ddev' alias dd='colima start && ddev start && ddev launch && ddev auth ssh' alias ddm='ddev launch -m' # launch mailhog alias ddr='ddev restart' alias ddp='ddev poweroff' alias ddx='ddev xdebug on' alias ddxo='ddev xdebug off' function rockshell() { ddev exec php rock "$1" }1 point
-
Thanks! This is an interesting approach, that I have never used before. This is what I get so far: 0 =>array 'file' => 'C:\xampp\webseite1\wire\modules\Process\ProcessPageView.module:184' 'call' => '$page->render()' 1 =>array 'file' => 'C:\xampp\webseite1\wire\modules\Process\ProcessPageView.module:114' 'call' => 'ProcessPageView $process->renderPage(Page $obj, PagesRequest $obj)' 2 =>array 'file' => 'C:\xampp\webseite1\index.php:55' 'call' => 'ProcessPageView $process->execute([ true ])' 1) returns the string as expected -> OK 2) returns the string as expected -> OK 3) returns the string as expected -> OK Unfortunately, every 3 calls return the HTML code as a string as expected, but thank you for this tip - I will keep this in mind for the future ?1 point
-
You could add something like this to your module that shows null: if(!$event->return) bd(Debug::backtrace()); The backtrace could have some helpful information what's going on before it is null.1 point
-
hi @szabesz thanks a lot don't know why each time i tried to erase empty lines it erased the code parts too, i probably should have wrritten the whole stuff as raw text and then only apply the code parts where needed thanks again have a nice day1 point
-
FORMATTED VERSION: in my config.php file $config->contentTypes = array_merge($config->contentTypes, array( 'css' => 'text/css' ) ); this adds the css file type in your template "files" tab / content-type select then, on top of my bibicss.php file <?php namespace ProcessWire; header("Content-type: text/css; charset: UTF-8"); header("Charset:utf-8"); and i linked to my bibicss page the usual way in the head of the pages that need it and it worked fine i think that would be the same for js files with a simple 'js' => 'text/javascript' and the correct headers Content-type in the template in case it helps have a nice day1 point
-
1 point
-
You would be surprised at what human beings are capable of.? Thanks, but my module is not a core one.1 point
-
Yep, I just wrote that and went for a walk with my dog. I was almost 50m away as I realized, that maybe I had misread the checkbox text. And yes, that did the trick. Sorry for my stupidity.1 point
-
I also have a 100% working spam protection technique I always use (and nothing more). See it working here: https://www.szepelet.com/about-us/contact-us/ Human Detection is a pure PHP random number, rendered by :after {content: attr(data-attr);} and the css class is deliberately not named with a related term, just to make it more obscure. No bots have been smart enough to crack it so far.1 point
-
1 point
-
@cstevensjr, this started on Wednesday of this week when Dreamhost made some bizarre unilateral ModSecurity setting that broke every ProcessWire site's ability to upload images or files. You have to open a support ticket and tell them to change the ModSec setting for every domain on your account to allow the CMS to work. They should be able to check their logs and know what to change, but you also might have to go back and forth with them and test it. I exchanged probably 10 emails with them on Wednesday while they repeatedly tweaked the ruleset until i was able to upload again. Last night i had to send them a list of ~20 sites that they had to adjust the ruleset for and they replied today that it is now done, but only time will tell if I start to receive complaints from site owners that they can't upload. This is certainly disappointing behavior from Dreamhost, and they should make amends. Hopefully they are going to learn a hard lesson once they get an avalanche of support complaints about this. By the way, you can easily tell what the problem is, if you upload while viewing the network panel. You'll see probably a 418 error and when you view the response you'll see Internal Server Error. 418 is the DH response for anything related to ModSec. In addition you can go into the server logs and open the log file (which may be pretty huge by now) and see the mod sec errors.1 point
-
You can always reset your password just by pasting this temporarily into any one of your templates, and then viewing a page that uses the template: $u = $users->get('admin'); // or whatever your username is $u->of(false); $u->pass = 'your-new-password'; $u->save();1 point