Jim Bailie
Members-
Posts
77 -
Joined
Everything posted by Jim Bailie
-
@da² Thanks, but the problem is that these full links need to be preserved because they're widely published inside this organization and among their clients and customers sales materials, so they have to be the same. I was hoping to have PW "fully" manage the files because it would be such a relief to the admins and would allow the org to track the viewership to a certain extent. I thought some of the information in this article would help, https://processwire.com/blog/posts/page-name-charset-utf8/ , but I just don't think PW is going to have anything to do with having a "$" anywhere near a url. ?♂️
-
Taking inspiration from @Robin S's recent tutorial, I told a client we could map all their old pdf file names/links to their newly migrated, and sanitized files in PW. No problem, right? Last night I set up the URL hook "/concepts/{filename}", and /concepts/My_Test_File4$$$.pdf doesn't even fire the hook and throws a 404. So I disabled the hook, created the page "concepts" with a template that allows all url segments. "/concepts/My_Test_File4$$$.pdf" throws a 404. I've read EVERYTHING google/forum will give me pertaining to URL hooks and special chars in page names and such. Just looking for one more trick before I have to go native and just duplicate all the migrated files in their original directory structure. Thanks!!
-
Update: Somehow by looking at Pagefile.php I was able to figure out how to set the uploadName via the API. It seems to work... $path = "/var/www/dvmrebuild/storage/"; $fileName = "My_Test_File4$$$.pdf"; $p = $pages->get(1214); $p->of(false); $p->venue_files->add($path . $fileName); $p->save('venue_files'); $p->of(false); $vfile = $p->venue_files->last(); $vfile->file_upload_date = date('Y-m-d'); $vfile->file_title = 'My Test File 4'; $vfile->file_original_name = $fileName; $vfile->filedata('uploadName', htmlentities($fileName)); $p->save('venue_files');
-
@Robin S It works! I was studying your module to see if I could start digging into it, but right now it might be one pay grade above where I'm currently at; though I feel like I'm catching up. Thank you again. And just FYI, note the placement of the rename/replace link: I'm on Windows, Firefox, Monitor at standard 1920 x Whatever
-
@bernhard Thanks for doing that. I'll dig up my github info and give a thumbs up. In the meantime, I'll try to cobble something together with some file template fields and some of @Robin S's examples above and in another post. I also wonder if the fact that the API does not preserve the uploadName cascades down to the fact that the uploadName is not set in Robin's file rename/replace module.
-
@bernhard Here's the test code. Pretty simple; it uploads the file fine with the sanitized file name. When I loop through after, it outputs the file name and upload name which are the same. $path = "/var/www/dvmrebuild/storage/"; $fileName = "My_Test_File3$$$.pdf"; $p = $pages->get(1214); $p->of(false); $p->venue_files->add($path . $fileName); $p->save('venue_files'); foreach ($p->venue_files AS $vfile) { echo $vfile->name . ' => ' . html_entity_decode($vfile->uploadName) . '<br>'; } # Outputs: # my_test_file3.pdf => my_test_file3.pdf
-
Hmm. Wow. This is great! I've got some work to do this weekend. I'll be testing this asap, but I will ask you in advance: Do you think the replace/rename module will preserve the upload name after replacement? Edit BTW, PW 3.0.226 - I'm not seeing the uploadName in the tooltip. The upload name was "conservation_station_tester2$$$.pdf" (see below) Good News -- I AM seeing upload names when looping via the API for files that have been manually uploaded Bad News -- Rename/Replace module DOES REMOVE the original upload name and replaces with the sanitized version. Bad News -- Uploading a file via the API places the SANITIZED value into uploadName I'd be grateful for any more insights or ideas you may have on how to proceed. Thanks again!!
-
We are transferring via API and it works fine. It's just that when event_concept_test$$$.pdf is loaded via api or manually, it DOES NOT retain the $'s And your tutorial is wonderful, but I really worry about confusion among the admins. If I understand correctly they won't see the non-sanitized file name and could lose track of which file is which if they check their work in the front-end.
-
Hello, So we're prepping to migrate a whole lot of pdf files into a new PW site and many of these files have a '$' in them indicating that they contain pricing information. Well pdf files with a '$' don't migrate so well into PW. In fact, they don't migrate at all. And I get it too. However, this is a very large company and these files are a source of truth throughout other systems as well. So, incredibly, this may actually be a show stopper. Any ideas on how this might be turned off in the core? I've tried everything else...I think.
-
@bernhard Ugh! This seems pretty straightforward as well. I'll be digging back into this this afternoon so, thank you. In a nutshell, the user is searching for a certain type of event (Breakfast, Dinner, Dinner and Show, etc). The result shows the desired events, no problem. Well these events can be held at many different venues of course. And these venues are scattered and grouped at many different locations. So I have to return a result that loops through these event types, and shows what venue they're at and the location that the venue resides. Simple right? But when I loop through these desired event types I need to show some images and data from the parent venues and grand-parent venue locations. So basically, what's the Processwire way of doing this? I think I'm getting close though... And thanks for the heads-up on Rock Finder! That may come in very useful with logging.
-
After an hour or so, I'm still not sure how to start in on this. How to loop through selected pages displaying some of their parent and grandparent data as well. In this case we have the following page structure along with the search results yielding all function types "Dinner Plated" along with all the function types of "Venue River" My concern is that looping through the result set and getting the parent/grandparent info in each iteration would get unwieldy at some point. I'm grateful if anyone can talk me onto the right path. EDIT: Ok, I found this which may be my starting point: https://processwire.com/api/ref/page/parents/ Venue Location Blue Venue Rock Function Type - Breakfast Function Type - Lunch Function Type - Dinner Plated Function Type - Dinner Buffet Venue River Function Type - Breakfast Function Type - Lunch Function Type - Dinner Plated Function Type - Dinner Buffet Venue Location Red Venue South Function Type - Breakfast Function Type - Lunch Function Type - Dinner Plated Function Type - Dinner Buffet Venue North Function Type - Breakfast Function Type - Lunch Function Type - Dinner Plated Function Type - Dinner Buffet Venue Location Green Venue Pool Function Type - Breakfast Function Type - Lunch Function Type - Dinner Plated Function Type - Dinner Buffet Venue Restautant Function Type - Breakfast Function Type - Lunch Function Type - Dinner Plated Function Type - Dinner Buffet Display Search Results: Venue Location Blue Venue River Function Type - Breakfast Function Type - Lunch Function Type - Dinner Plated Function Type - Dinner Buffet Venue Location Red Venue South Function Type - Dinner Plated Venue North Function Type - Dinner Plated Venue Location Green Venue Pool Function Type - Dinner Plated Venue Restautant Function Type - Dinner Plated
-
How To -- Global Object / Dependency Injection
Jim Bailie replied to Jim Bailie's topic in Getting Started
@ryan Perfect. Very helpful with both PW and PHP fundamentals. Thank you~ -
Hello - So I have this object that needs to run on every page load or ajax call. What's the PW way of making this object available? I've pretty much landed on either putting it into a module OR adding it to the wire function. I will say, I'm a little rusty on my OO PHP skills, so if anyone could talk me through either scenario or can offer a past post/example, I'd be grateful.
-
Obviously this can be done with PW, but it's hard to even know how to re-invent this wheel without spending a day or two interviewing your client and sketching out a stack of wire-frames. Probably not what you want to hear, but I'll just throw this one out there: We've *HIGHLY* customized this gem for 3 mid-sized B2B clients needing pretty much the general functionality you've mentioned. It's based on CodeIgnitor (sp?) and is pretty simple to trick out. https://codecanyon.net/item/perfex-powerful-open-source-crm/14013737
-
Interesting topic. I was in a very similar situation watching MySQL's performance degrade on a well established LEMP app located on an Ubuntu 14.04 Droplet. On that server, I installed an instance of Percona's MySQL (maybe v5.7*) and bang! Everything was fine and remains that way 3 years later. Total mystery...
-
ProcessWire on Azure App Service with PHP 8.x
Jim Bailie replied to Kiwi Chris's topic in General Support
I would think just a correct nginx config is all you need to worry about. Here's where I started from: https://gist.github.com/LostKobrakai/b895e2e0e8a2c14b4da88cc7e16cf954 -
Thank you! That's ok, no rush! This is a slow moving rebuild of an ancient application. We have to be careful because once images are programmatically migrated by request to the old app, the links can never change from that point. And we have to make sure it's somewhat bullet-proof because of the non-technical skill levels of the admins. And MM would be great for their workflow. However, as far as pdf files go, which I'd like to have in place soon, I did find the module "Files Rename Replace" which gets me to a place where we can start testing/demo'ing
-
Two months or less? ?
-
@kongondo Pre-sale question: Does MM have a setting for overwriting existing files/images when updating? It seems like it would. As an example let's say I have tiger.jpg and want to update the image with lion.jpg...but keep the name tiger.jpg while displaying the new lion.jpg...does that make sense ?
-
Select from a list of existing pieces of content
Jim Bailie replied to Jim Bailie's topic in Getting Started
Ugh, I knew it was this straight forward. Thank you both! @Gideon So @gebeer -
I'm sure this has been explained numerous times, but I'm struggling trying to find the best way to go about this scenario: So the user creates a new page and then is able to select from a drop-down, a number of pieces of existing content items that will render in the template in the order selected. I'm assuming these pieces of content will reside in their own individual, grouped pages without an associated template. In the main template I would then loop through these selected pages and output as desired.
-
@Guy Incognito Your above explanation on url segments is very interesting. Can you expand any further on how you set this up? I've read through https://processwire.com/docs/front-end/how-to-use-url-segments/ , but I'm still not fully absorbing what I think is your approach. I'm sure the parent could benefit from this approach as well.
-
This request was aborted because it appears to be forged (NGINX)
Jim Bailie replied to anttila's topic in General Support
I'm sorry I don't have any silver bullets, but I've been through this on a development machine and from what I remember, it came down to permissions/config files along with netplan and how I accessed the apps via nginx.conf (i.e server_name). For development, I've always used IP aliases in /etc/network/interfaces a'la ifupdown and set my nginx server blocks to listen to such IP addresses. Netplan doesn't allow this. It says it does, but I don't feel like writing a PhD thesis to get it to work, so I removed netplan and replaced it with ifupdown. I'm not telling you to do this! I did it because I understood the problem and just wanted to use the network stack like I always have.