-
Posts
10,896 -
Joined
-
Last visited
-
Days Won
348
Everything posted by adrian
-
Sorry @bluellyr - my apologies - I didn't initially realize what you meant by "template context". Using Tracy to debug the PW core is hit and miss. It loads before all site modules, but for the core and core modules it often isn't available depending on exactly what you are trying to debug. Unfortunately there isn't anything I can do about this. Typically for this, using $log->save('testing', json_encode($page)); or something like that is your best bet.
-
Hi @bluellyr - in general you should use the shortcut methods: bd(), d(), l(), fl(), etc but if for some reason you don't want to, try: \TD::barDump('test'); The reason you need the backslash is because your template files have the ProcessWire namespace so you need to get to the global namespace to access the TD class.
-
Automatic text translation by support for Deepl translation API
adrian replied to bartelsmedia's topic in Wishlist & Roadmap
I am not the right person to really comment on this given that the only abilities I have in a second language is a smattering of travel Spanish, but this does seem pretty cool and makes you sound a lot less silly ? DeepL Google So, a DeepL module sounds like a pretty cool idea to me. -
Files field returning null unless I use getUnformatted
adrian replied to adrian's topic in General Support
Well I discovered the reason for the temp status issue in this case. I recently made a change to my Custom Upload Names module to add the temp status after renaming the file - this is because a PW rename() call removes the temp status so I wanted it added back in case the page was never saved. The problem is that PW doesn't use the temp status when you have the field's "override existing files" option checked. So, I have updated my module to not add the temp status when the field uses the overwrite setting and now we're all good. The thing is though that I've seen this issue before I added this feature to that module and I've also seen it on sites where I don't use the module at all. I feel like something should still be reported, but at the moment I am not sure how to reproduce the problem without the module being the cause. Perhaps as @Robin S pointed out, temp files should be deleted on page edit, in case they weren't deleted on page save. Do you guys think that is worth a bug report / suggestion? Maybe another component to it is to ask Ryan why temporary files are included when getting unformatted - maybe that makes sense for internal needs, but I think it's confusing for the API to contain these images. Any thoughts? -
Files field returning null unless I use getUnformatted
adrian replied to adrian's topic in General Support
Ok, so I've done some tracing to see what is going on and it's because the files are being tagged as temporary. This is the key line: https://github.com/processwire/processwire/blob/649d2569abc10bac43e98ca98db474dd3d6603ca/wire/modules/Fieldtype/FieldtypeFile.module#L411 that is causing it to return null. When a file is added, it is initially set to temp: https://github.com/processwire/processwire/blob/649d2569abc10bac43e98ca98db474dd3d6603ca/wire/core/Pagefiles.php#L347 so I guess for some reason the file upload process didn't complete properly so the temp status (timestamp) wasn't updated. Thing is that the files are fully uploaded and there is nothing wrong with them. I just manually changed the created dates in the database, via Adminer of course ?, and now everything works as expected. @Robin S - you seem to be the expert in issue reporting these days - any thoughts on the best way to handle this to explain best to Ryan? -
Files field returning null unless I use getUnformatted
adrian replied to adrian's topic in General Support
@matjazp - no hooks on url, but I think it's before that anyway, because even $page->document_url returns null which is very weird. @Robin S - I tried renaming but no luck. I have seen this on several sites over the years and typically don't have time / energy to post about it. I am surprised it's not reported by others more often, but I guess give that @Autofahrn has experienced it and not reported also indicates that maybe it's not that uncommon. I guess also, the maxFiles setting of 1 is not used as often as 0. -
Thanks for the report - looks like the new Tracy core is forcing strict rules in JS which is affecting some sloppiness in my code. I have fixed this one, but I think we'll need to lookout for issues like this.
-
Files field returning null unless I use getUnformatted
adrian replied to adrian's topic in General Support
Agreed, and this is even weirder - look what happens when I call d($page->document_pdf->url); before the others - even the getUnformatted version is now broken. -
Files field returning null unless I use getUnformatted
adrian replied to adrian's topic in General Support
Thanks for the confirmation @Autofahrn - I have had to set to return Array on other sites as well for no discernible reason. In this case, they are both multi-language sites, although in the case of the site that's not working, there is actually only one installed language - I wonder if that might be related? -
Files field returning null unless I use getUnformatted
adrian replied to adrian's topic in General Support
I have included those in the dumps above - note that outputFormat is set to "0" on both sites. This is the "Automatic (single item or null when max files set to 1, array of items otherwise)" option. It actually doesn't even help if I set the field to array or single item - the formatted version always returns null. -
This is really weird - I have two site which are on the same server and are basically identical. For one site there is no problem, but the other one exhibits this weird bug. This is the version with the problem This is the one that works as expected There are no relevant hooks that I can think of. Can anyone see anything I might be missing or do we think this might be a weird bug?
-
TypeError: a.ProcessPageList is not a function in Admin
adrian replied to gebeer's topic in General Support
Hey @gebeer - I just stumbled across this again - do you know if this was ever reported on Github? I am still using that hack here on a couple of sites, but not sure if it's still needed, so just wondering if you had any more recent info on it. -
@Robin S - to support the textareas pro field, I think you'll need to add a new block after these: https://github.com/adrianbj/BatchChildEditor/blob/85d81d7e7cb452c0d5ece34583e42c1f2f4aae50/BatchChildEditor.module.php#L1644-L1649 and a updateTextaresField() method to handle the import. This might actually work for other simple multivalue fieldtypes, so perhaps it could be: elseif($f->type instanceof FieldtypeMulti) { Not sure you timing on needing this. If you don't get to it (or decide to take a different approach), I'll try later in the week.
-
Hey @Robin, I don't have much time, but some quick answers to hopefully get you going: 1) It does support multi value fields, but it does so with a multi-value separator (default is: |) so you would need to concatenate your separate columns into one with a separator. 2) I believe it should support importing for different templates for child pages, but only for one to one column to field relationships. I think where you will have trouble is if you want to match specific columns to specific fields. This leads into your next question. 3) If you have a mismatch of columns to fields, then you will want to use the "Field Pairings" feature. This is available if you make the parent a "configurable page" in the module settings and then define the pairings on the settings tab of that parent page. 4) See answer to 3 ? 5) Currently there is no match by ID - if you are doing an "update", then it's all based on the order of child pages. Maybe this feature could be added though. Hope that helps. Cheers!
-
Not sure where to report code sample typos in the API docs?
adrian replied to rastographics's topic in General Support
https://github.com/processwire/processwire-issues/issues/797 -
I think so - even if the CSS approach works, it' really strange to me that the 404 page affects trash for all - sounds like there is still a bug there somewhere.
-
Thanks @nbcommunication - could you please highlight the new features you've added? I did a diff on yours vs @Macrura's but there are so many changes, it's hard to pick out what is new. Thanks!
-
Is there a reason you can't move the hook to ready where you will have the page object?
-
@Zeka - what @bernhard said ? His Request Logger panel is awesome for this!
-
I can confirm that @Rudy suggestions work here. In fact smtp-mail.outlook.com seems to be one of the last SMTP servers that actually still works when called from a web app. I haven't had any luck with gmail's service recently. In fact, I have completely abandoned SMTP and use MailGun for everything these days - it's much faster via the API, than an SMTP call (no delay for the user), is free for 10,000 sends a month. The only downside is the initially setting up of domain records if you're not familiar with it or don't have access to change them.
-
Are ready.php hooks/addHookMethods called outside their use?
adrian replied to a-ok's topic in General Support
BTW, if you are hitting limits with that service, maybe try https://ip.nf/ or https://api.ip.sb/geoip - the former guys are very supportive of PW. -
Sorry, perhaps those should not be disabled by default - generally I find it a bit obtrusive having the debug bar on in a modal and in general we are talking about the PW admin for these, so usually you don't need to debug them. Occasionally I enable them for a particular need.
-
Are ready.php hooks/addHookMethods called outside their use?
adrian replied to a-ok's topic in General Support
Sorry, yes it should - I didn't read the code in your head.inc - I assumed an session setting and checking would have been in the hook. Are you sure it is being called on every ready load? I think you need to do some simple debugging and log or do a bd('called') type check inside the hook and load pages on your site and see what happens. -
Also, have you read this: https://tracy.nette.org/en/open-files-in-ide - not actually sure whether you need this or not. I don't think I ever heard from the Windows folks whether this was needed or not.
-
Does this help: https://github.com/shengyou/vscode-handler