Leaderboard
Popular Content
Showing content with the highest reputation on 07/27/2023 in all areas
-
Updating this for further future reference for Dreamhost customers. Their support team mentioned that they had added a specific rule to their custom ModSecurity handling for the /processwire/ admin URL path. If you change the administrative path for security-by-obscurity, then their ModSecurity rules will kick in and all of the things that used to get blocked, get blocked again. You'd need to contact their support and have the settings applied per-site, per custom URI path. Their support team is great in working with their customers, at least. ?3 points
-
@lele_ballack, I believe it's a bug with the field export/import for repeaters. I opened a GitHub issue here: https://github.com/processwire/processwire-issues/issues/17923 points
-
I can't find any documentation at this moment that shows this working, and I don't have any sites that come to mind where I could test this, but I think it works... If your search is only searching pages that have a template of 'product' (or whatever your product template is), I believe you can use this: sort=-parent.archived This assumes that the value of archived is 1, if it is indeed archived.2 points
-
I am wondering what would be the best workflow to handle (for example) file downloads inside textfields which make use of the TinyMCE. Imagine having a text and somewhere inside the text you want to offer a download link for a PDF document. Nothing special so far. This is no problem as far as the PDF file you want to download is uploaded somewhere in the system in the first place. That means the page you are editing which contains the text field usually does not have a file field for uploading content. This is often the case when working with repeater matrix fields. You just get the blank text field in that case. So in order to make the file download working it seems you always have to make a "global file download list" field on a separate page (maybe a "settings" or "downloads" page) and first upload the file there. Then you can chose that file from the textfield. Having in mind that technically not so experienced users who edit the website might use this workflow seems not ideal. If you want to link to a file you should be able to upload the file directly in the popup window instead of selecting "chose file from page".2 points
-
That is what I am doing. I usually add a file field "downloadsForTextareas", which is collapsed if empty by default, to the bottom of the template. That would be nice but works only for images as far as I know, and I have not really used this option yet. I would be nice, if one could set a preferred file field for downloads in the field settings. ?2 points
-
You can find here the release of wire-cli, successor to wire shell, a powerful command-line interface (CLI) tool designed specifically for ProcessWire developers. Optimize your workflow, automate repetitive tasks, and manage your ProcessWire projects with ease. Wire-cli leverages the Symfony Console Component to provide a robust CLI experience, offering a wide range of features and commands to enhance your development process. From creating new projects and managing fields, templates, roles, and users, to performing database backups and serving your ProcessWire projects with a built-in web-server. Still in development, there might be some glitch, I will continuously improve and expand its functionality based on the feedback and needs of the ProcessWire community. Also mentioning that we will be probably working towards merging the features of wire-cli and rockshell to provide a unified CLI solution for ProcessWire. To get started with wire-cli, check out the GitHub repository or simply install it now from your terminal using Composer: composer global require wirecli/wire-cli Contributions are welcome. If you encounter any issues or have suggestions for improvements, please submit an issue, a pull request or post it here.1 point
-
@lele_ballack, Ryan has fixed the issue in a recent commit on the dev branch.1 point
-
You could use the Find Merge module and supply it with two selectors: one for products without an archived ancestor and one for products with an archived ancestor. You'd probably start by finding the archived categories, then your selectors would include "has_parent!=$archived" and "has_parent=$archived".1 point
-
Does this help? https://processwire.com/blog/posts/processwire-3.0.107-core-updates/#trash-for-all Found here:1 point
-
Thank you @Robin S for opening the issue on GitHub, I feel a bit less crazy knowing I'm not the only one with this issue as I was nearly losing my mind!1 point
-
Running ProcessChangelog shows that it is connected with PageHitCounter, but is from a LazyCron hook I created which updates related fields, without specifying 'quiet' ?1 point
-
I'm seeing something similar on a site where I imported a repeater and now it's being saved in a part of the page tree I would not have expected. Also, pages using the template into which I added the repeater are being saved in the same part of the page tree. I'm running on v3.0.204 dev.1 point
-
It looks like an issue with your monaco loader script. If you remove that from profileeditor.php then the error goes away and Tinycon is loaded and works as expected.1 point
-
I also use AppApi frequently, you can pull it from AppApi if the code is server side, or, with js dotenv(): // .env file SECRET_API_TOKEN=abcd00001234 // your module/template code <script> const MyApiCall = async (url) => { let connect = await fetch(url, { method: 'GET', credentials: 'same-origin', mode: 'same-origin', headers: { 'x-api-key': process.env.SECRET_API_TOKEN, } }) let result = await connect.json() return result } </script> But it seem you are writing js code from php templates instead of using js components and/or a built app, then: <?php // load .env $dotenv = Dotenv\Dotenv::createImmutable(__DIR__ /* where is .env file */); $dotenv->load(); // ?> <script> const MyApiCall = async (url) => { let connect = await fetch(url, { method: 'GET', credentials: 'same-origin', mode: 'same-origin', headers: { 'x-api-key': <?php $_ENV['SECRET_API_TOKEN'] ?>, } }) let result = await connect.json() return result } </script> dotenv. You just do not want to leak it, whatever the method used. Maybe just try to find an article that correspond you better to understand the process.1 point
-
Not super sure if these have been brought up but I'll lay my experience so far. Problems solved for me and what I liked the most about: It solves sharing the exact environment with other devs within the project itself. I just recently started working with someone who I am also training and to put and example, explaining how to do aliases for php versions in MAMP Pro was a pain, running composer had to be done all with absolute paths for the php version, the composer install in itself too, etc. So even if trivial for an experienced dev, it does introduce friction for less experienced ones. It's all there right after the ddev start, clean and isolated from whatever other project. Of course, maybe there was a cleaner way to do this I never never got to know 'em, don't wanna trash MAMP Pro haha. All the command suite, but specifically love the database import/export ones no need to open phpmyadmin anymore for a simple db import. I really understand the value now of each project running separately. One example, it had happened to me that I was running a database of a few GB in MAMP PROs single installation and it was a pain to turn on and off when I had to update any php.ini configuration since it brought up and down the whole thing, even if I was working on a completely different project than the mentioned big database one. I also didn't love the phpmyadmin screen full of ALL the databases from ALL the projects. It's been really easy to move everything to ddev! It got me into development with Docker and the whole Docker topic in general which wasn't something I was really into since I didn't "need" it. Now I am looking into how to leverage this to deploy productions sites with containers. Maybe this could a whole other topic for another talk? I am trying to move away from panels such as Runcloud/Ploi into a "cloud services" approach and I have the feel that Docker is crucial to this. Pain points: Probably the only pain point I've had is that on a laptop where I might have had docker installed before, I ran the installation commands and got into this issue. But I am not really sure on how to give more input here since I went into "delete all and reinstall mode" and it just worked. Also in my main computer I decided to try Colima and realized that the container volumes were not the same! Maybe this is obvious if you are familiar with Docker. But overall these paint points seem to be very specific, "layer 8 cause" problems haha.1 point
-
Like last week, work continued on preparing our next main/master version by working through remaining issue reports, this week with a focus on older and previously missed reports. Thanks for bumping up any that we may have previously missed. Thanks also to @matjazp for helping to identify and prioritize them. In addition, the version number was updated to 3.0.223 this week, as there were enough changes to warrant differentiating it from 3.0.222. It wasn't all issue fixes this week, as several minor additions and improvements were completed as well (see the dev branch commit log). Next week will continue along the same path. Thanks and have a great weekend!1 point
-
One method would be to combining two finds, something like this: $results = $pages->find("search_index%=$query, has_parent=1234"); $moreResults = $pages->find("search_index%=$query, has_parent!=1234"); $allResults->import($moreResults); $limitedResults = $allResults->slice(0, 15); Note that setDuplicateChecking() can be useful with import() when doing this sort of thing. Perhaps someone else knows how to do this with a single selector!1 point
-
This should work <?php $page->of(false); $page->mystique_field_name->property1 = 'data'; $page->mystique_field_name->property2 = 'data'; $page->mystique_field_name->property3 = 'data'; $page->mystique_field_name->property4 = 'data'; $page->mystique_field_name->property5 = 'data'; $page->mystique_field_name->property6 = 'data'; $page->save();1 point
-
Thanks. I'll try that tomorrow morning. The reason I need it in the frontend is simple: The various fields generate product specifications in the frontend, as lists or tables. Having to hardcode the field-labels for each addtl. language in the template, when it is already defined in the backend, seems unneccessary, tedious duplicate work. Most values are numeric, but the titles (labels) are always strings. I don't think it's that much of a rare / exotic situation. After all, an english speaking visitor wants to see "weight", not "Gewicht". A French guy expects "poids", etc.1 point
-
This Page::render is kind of a special case, because there isn't actually a Page::render() method if you look in the Page class. It is itself a hook added by the PageRender.module. So you can't replace it since the method doesn't actually exist. Instead, you'd have to hook the source of that Page::render hook, which is actually: PageRender::renderPage.1 point
-
If you hook before render, there's no $event->return (yet). So you can't replace anything, only if you echo out your stuff and exit() it will work. This has been like this ever since, and I know because I played with it, but never actually needed it or seen any use for it.1 point