-
Posts
11,263 -
Joined
-
Last visited
-
Days Won
374
Everything posted by adrian
-
module Module ImageReference - Pick images from various sources
adrian replied to gebeer's topic in Modules/Plugins
@gebeer - I am sure you have already thought of this, but if you're changing to only support selecting a page (and its children), you could make use of PW's API to load up the images in the picker field, rather than scanning the server folder directly. I don't think there is a reason not to change. -
Can't log in after installing tracy debugger
adrian replied to Haterearged's topic in Themes and Profiles
You should be able to do that with any module, but you will likely also need to delete its entry from the modules DB table so that PW isn't looking for it. That said, I'd like to know more about the login issue - never heard anyone have that problem before - those details on PHP version etc will be useful. -
module Module ImageReference - Pick images from various sources
adrian replied to gebeer's topic in Modules/Plugins
What about adding the image description, width, height, and filesize to the tooltip and under the selected image? -
module Module ImageReference - Pick images from various sources
adrian replied to gebeer's topic in Modules/Plugins
Makes sense to me ? -
module Module ImageReference - Pick images from various sources
adrian replied to gebeer's topic in Modules/Plugins
I was thinking this would be optional - I don't think anyone has to set this up - the module would scan these only if they exist. -
module Module ImageReference - Pick images from various sources
adrian replied to gebeer's topic in Modules/Plugins
I might be getting carried away, but I think it might also be nice to be able to select images from child pages of this page as well - I can see a use case for categorizing images and I think this would be a decent way of doing it. Perhaps the picker could even have a dropdown that lets you filter by child page (category). What do you think? -
module Module ImageReference - Pick images from various sources
adrian replied to gebeer's topic in Modules/Plugins
I could, but I am not sure if you want to refine things a little more than my quick hack. I just replaced all instances of $this->config->paths->templates and $this->config->urls->templates with $this->config->paths->root and $this->config->urls->root I think perhaps it would be better to have an option in the field's settings to actually choose a page rather than manually /site/assets/files/xxxx - what do you think? -
@bernhard - just submitted a PR for the childTemplates and parentTemplates removal issue (https://github.com/processwire/processwire-issues/issues/802) https://github.com/BernhardBaumrock/PwCoreFixes/pull/1 One thing to note - I think you should perhaps set the autoload value of this module to 99999 - the reason being that Tracy's Admin Tools panel has a "Template delete" tool that allows you to delete templates that have associated pages in one step - it deletes the pages for you first and then the template. The problem is that because Tracy is set to autoload at 9999 it deletes the template before this fix is applied. The catch with loading this before Tracy is that then you can't use bd() calls to debug this module or the fixes you are writing for it, so not sure what is actually best ?
-
module Module ImageReference - Pick images from various sources
adrian replied to gebeer's topic in Modules/Plugins
I just implemented it here: The only changes I had to make to the module were to set the root path higher than the default site/templates/ so that I could point it to /site/assets/files/xxxx and it works brilliantly! BTW, this is what the Global Images page looks like: -
I think this could be handled automatically. If this module created a unique identifier for each installation then with each module settings save the ping would update the stats for this install by passing that identifier along with the fixes that are enabled / disabled. Make sense?
-
module Module ImageReference - Pick images from various sources
adrian replied to gebeer's topic in Modules/Plugins
Thanks @gebeer - this looks really useful! I wonder whether it would be useful to have an "Upload Image" option so that site editors can easily add images to this global directory so they don't need to resort to FTP or engaging their developer to add new images. I suppose the alternative would be to create a "Global Images" page in the page tree and point this module to the /assets/files/xxxx/ directory for this page - maybe that's actually the better approach? Anyway, I can definitely see using this quite often! -
I really like this idea and almost see it as more important than fixes that this module might contain. This is something Bernhard could implement pretty easily - whenever the module's settings are saved, it could ping a server of his with a list of which fixes are enabled. The catch of course is that some users may not want these stats tracked. Perhaps there could be an option to allow / deny tracking? It would also be great if it didn't capture any site details. Any thoughts on this @bernhard ? It would be great to show Ryan how many people some of these issues affect.
-
Maybe it is art, but you know what would be logical and efficient ? ..... fixing issues via PRs ?
-
Hey @bernhard - you've probably already seen this comment via Github, but I'll repost here for others. I like your proactive approach with module, but I fear that it might actually slow down fixing these things in the core because if users start adopting it, they'll be less likely to add their voice to the actual issue reports and so Ryan won't see that the issue affects other users as well. I hope I am wrong though and I really do appreciate your effort!
-
Thanks for all the great updates (and the new examples) Chris, Latest version is looking good so far - I expect I'll be testing more again tomorrow and will let you know if I notice any issues. Cheers!
-
Thanks Chris, I had forgotten about the ability to pass an array to the wireMail to() method - I was thinking it only handled one address or address / name pairing. Perhaps given that, there isn't really a need to pull the email and toName from the recipientVariables array, although it is a nice shortcut still. Sorry if I sent you on a wild goose chase with that. One minor point - do you know why in my email client (Mac Mail) there is a comma after the "to" address, even if I only send it to one recipient: It's not super important, but it seems a bit weird and wasn't happening before I started using batch mode.
-
Just testing this new version (using my code above) - it now works for one recipient when batchLimit is set to 1000, but if you are sending to 2 or more (presumably anything up to 1000), only the first recipient is sent the email. Sorry, I think it is actually working - looks like my email client is not showing one of the messages because perhaps it thinks it's a duplicate even though they are going to different addresses?
-
There's a good chance I don't understand how this is meant to be done. I assumed that using addRecipientVariables() completely negated the need to use the to() method. In my mind, the to() method only makes sense if you are sending in non batch mode. How do you use it in batch mode for sending to multiple recipients - I don't understand that. Also, I am curious about the toName() method. I thought the way you had things set up, in batch mode you should use this, but rather add a toName key to the recipients array. This is basically what I am doing where $recipients is a PW page array: $recipientsArr = array(); foreach($recipients as $u) { if($u->$email) { $recipientsArr[$u->$email] = array( 'id' => $u->id, 'toName' => $u->first_name . ' ' . $u->last_name, ); } } $mailer = $mail->new(); $mailer->setBatchMode(true); $mailer->addRecipientVariables($recipientsArr); $mailer->from('me@google.com', 'My Name); $mailer->subject($newsletter->title); $mailer->bodyHTML($message); $numSent = $mailer->send(); Does this make sense to you and should this work with your most recent commit?
-
I think the issue is that on line 469, the value of $this->mail["toName"] passed into getEmails() is an empty array. I think this is because we don't explicitly set it in batchMode when passing recipientVariables, so we need the logic inside the if($deferredCount) section to handle getting the email's details. Thanks for looking into it.
-
@nbcommunication Thanks Chris for the speedy work on this - sounds great! The catch I am seeing is that if you try to send to less recipients than "batchLimit", the "if($deferredCount)" check fails and you end up without the "to" address being set. Can you confirm the issue at your end as well?
-
Hi Chris, Thanks for your hard work on this! I am about to implement this new version and will be looking to use the batch sending option but noticed the 1000 recipient limit. Then I discovered the MailGun's PHP-SDK handles this for you automatically: https://stackoverflow.com/questions/36063534/mailgun-api-batch-sending-vs-individual-calls https://github.com/mailgun/mailgun-php/tree/master/src/Message Any thoughts about implementing the SDK into this module to make batch sending a little easier? Thanks, Adrian
-
Now that PHP 7.4 is stable, I have updated the Tracy core to the latest version and also made a few other fixes to the module for PHP 7.4. Please let me know if you notice any problems. Note that this issue in the PW core (https://github.com/processwire/processwire-issues/issues/1041) currently breaks the RequestInfo panel on 7.4.
-
You can also modify breadcrumbs as needed, eg: https://github.com/adrianbj/AdminRestrictBranch/blob/4964a3f5b83338f7313f7c6daeefe6c6793640b0/AdminRestrictBranch.module.php#L131-L144
-
Not terribly helpful, but here is an old discussion about this:
-
@formulate - I think Pete ran out of steam on this years ago, which is when I picked it up, but I haven't actually ever used it myself so my motivation to continue is not really there I'm afraid. The module really needs a complete overhaul and most importantly needs a replacement for the flourish library which is no longer maintained. Do you feel like investigating alternatives for Flourish and perhaps taking over the module?