Jump to content

JayGee

Members
  • Posts

    247
  • Joined

  • Last visited

Posts posted by JayGee

  1. On 4/11/2024 at 8:01 AM, erikvanberkum said:

    Having same issue with cloudflare as soon as i enable a "proxied" connection, I continously get logged out. When using the cloudflare setting "DNS only" the issue gone. Need to further investigate processwire .htaccess settings as their are options how for running behind a proxy.

    Just an idea - not particularly thought through so may not work!...

    Because you can so easily add another URL to ProcessWire sites via the config, I wonder if you could use a separate URL or subdomain for editing access that doesn't go through CF. You could restrict access for editing by IP so other people can't use that domain.

  2. On 4/7/2024 at 8:13 PM, fruid said:

    @adrian I get the following error with your fork version: 

    385:                $pageData['og:image'] = $pageData['image'] ? $pageData['image']->httpUrl() : '';

    The error only occurs on the "home" page and on direct children to home, not sure if that's important to mention, nor sure if the problem occurs because it cannot find an image to inherit? 

    We use various versions of this module on a lot of sites and I also haven't come across this. Do you have the actual error message?

    • Like 1
  3. On 4/6/2024 at 7:58 PM, wbmnfktr said:

    Why is it that the bad guys are always so creative? They have the nicest hacks and ideas.

    Have you ever listened to the podcast Darknet Diaries - this is the exact vibe I always get about how these hackers are operating. Begrudging admiration for the ideas they come up with.

     

    On 4/6/2024 at 5:19 PM, netcarver said:

    Looks like the next level of Business Email Compromise just became unlocked (if it wasn't already.) Lutra Security have a nice write-up on the attack they are calling "Kobold Letters".

    Basically, email clients change the DOM of the email when they forward it, allowing different CSS to apply between the first recipient viewing an email, and subsequent recipients. Allows an innocent-looking "request to forward to the CFO" phishing email to the CEO to become a "request to send funds/data" when received by the CFO from the CEO.

    Explict verification of the request contents needed now, not just a "Did you send me a message?" question which only verifies that the message was forwarded.

    Something to be aware of if you work in a team or are responsible for any kind of staff training on phishing etc.
     

    Given that most email css is inlined, does this require the machine or platform of the mailbox doing the forwarding to be compromised? Otherwise how are they modifying the CSS without the forwarder's intervention?

    I guess a dodgy browser extension could also do this 😕 I.e. target the CSS of known mailboxes e.g. when you visit gmail or outlook.

     

    EDIT: After reading the article I realise I misunderstood the concept. So they're not modifying existing emails, they're sending and email with this method build in as hidden payload. I guess the lesson being to ensure trust of the original message.

    • Like 2
  4. On 1/17/2024 at 1:36 PM, fliwire said:

    Same issue:

    $collections->sync_queue("product={$product}, limit=1");  // this not work in hook
    $collections->sync_queue->find("product={$product}, limit=1"); // this works if pagination limit not enabled in settings.


     

    I think you may have made the same mistake I did in that original post...

    $collections->sync_queue("product={$product}, limit=1");  // this not work in hook

    should be:

    $collections->sync_queue->find("product={$product}, limit=1");  // this not work in hook

    (find missing in the top one).

  5. 2 hours ago, Denis Schultz said:

    yes. Without problems.

    On which Processwire version are you?

    It was on latest stable 3.0.229. Updating to latest dev 3.0.231 seem to resolve it.

    For clarity I'm doing to work updating a fairly old site - so I can't 100% say it isn't something in the legacy code or a Handover from the older PW version I updated from.

  6. Are people still actively using Hanna Code? I'm trying to do an install of it on a site for the first time in a while. Hitting a problem getting the module to install.

    The text formatter will install, but not the Hanna Code module meaning I don't get the editor (even with the config added or site in debug 😞).

     

    image.thumb.png.d94b8bf7bc7b75f5029485d87b79fe76.png

  7. Just checking something I've not done before...

    I've upgraded an old site to PW latest stable and I want to add some new features using MarkupRegions but only on one template.

    I've enabled MarkupRegions in config as usual but skipped the append. I've then appended my _main.php file in the template settings instead, so as to target it only to one template type in the site.

    $config->useMarkupRegions = true;
    //$config->appendTemplateFile = '_main.php'; <--- added this manually to one template in the UI instead of via config.php

    Is this ok? It seems to be working, but just checking I'm not introducing any unforeseen pain? I've only ever used MarkupRegions as an all-of-nothing type thing before!

  8. 11 hours ago, monollonom said:

    I’ve never worked with panels (just yet) but from what I’m seeing if you have a view ready in your Process module, say “__executeSomething()”, isn’t it just a matter of having a link pointing to that view?

    <a href="/something/" class="pw-panel">Open in panel</a>

    Yes this is what I was doing... but turns out I had a typo and it was loading my 404 page in the panel I think. This is why I was getting the nav bar showing 🙈. The panels now work exactly as expected (and as you describe) to load my module functionality! 🥳

    • Like 2
  9. Sorry to be clearer on my question - what I'm wondering is whether there's a core method for injecting dynamic content to PW panels and modals in the dashboard rather than writing new logic. I know you can load a page into the panels, however that then seems to reload the whole dashboard interface including nav etc inside the frame.

  10. Hi all,

    I'm looking for some examples/guidance/tutorials on how to populate a PW panel from a module.

    I know you can open a UIKit panel with a .pw-panel css class and that you can populate it with a custom admin page. But I'm wondering the best approach to populating with dynamic module-specific content, e.g. a form?

    TIA
    J

     

  11. Quote

    As you can see, there are a lot of potential pitfalls, so use care with multi-instance.

    I think some of the confusion arises around mixing terms for bootstrapping and multi-instance.

    Unless I'm mistaken, I've always taken multi-instance to mean a multi-site scenario. I.e. multiple sites running off one core or database (or various combinations of this). Whereas bootstrapping allows one codebase to interact (including page creation) with the API of 2 disparate ProcessWire installations without needing to create your own custom endpoints.

    But as @Robin S has highlighted above I'm pretty sure I've been able to write ok to bootstrapped PW instances, although it has been a while since I've done it so would need to test to be sure.

  12. Cool - interesting insight thanks just to see what others are doing.

     

    11 hours ago, DrQuincy said:

    My question above was really to see if I could copy info between the sites within the same script. While Robin S's link was useful, it would appear to be for read-only so I didn't end up using it.

    You could also try the bootstrapping method which I think would allow you write between sites too through the regular PW API.

    https://processwire.com/docs/front-end/include/

    • Like 1
  13. On 8/21/2023 at 11:06 AM, DrQuincy said:

    If I had sites A and B is there a way in site A to create an instance of ProcessWire\wire() that is connected to a completely different site? The reason I ask is to sync some data between two different sites on the same server on the fly.

    E.g. on site A:

    $page1 = wire('pages')->get(/foo-bar/);
    
    $page1->of(false);
    
    $page2 = new \ProecssWire2\Page;
    
    $page2->template = $page1->title;
    $page2->title = $page1->title;
    // and so on
    $page2->save(); // Saves to site B

     

    Purely out of curiosity can I ask the nature of your project you need this for? We’ve done a few app projects where we’ve considered separation of concerns over multiple PW instances but have never ultimately thought it would be beneficial versus just running 1 site. 

  14. 1 hour ago, szabesz said:

    It is definitely not, I agree. I think even the introductory blog page does not make it clear what the purpose of DefaultPage actually is: https://processwire.com/blog/posts/pw-3.0.152/

    And a lot more could be documented and supported, see my old thread, for example: 

     

    I completely missed your thread on this when searching this issue - some helpful stuff there thanks. 

    • Like 1
  15. 11 hours ago, iank said:

    Just a thought - do you have your template specific classes extending 'DefaultPage' rather than 'Page'  ?

    The scenario you're describing has always worked just fine for me. 

    Ahhhh thank you - penny drops, aha moment! 🤣

    This works - the template-specific classes need to extend DefaultPage and not Page... painfully obvious with hindsight that it should follow usual inheritance rules. I'm not 100% sure it's clear from the docs though, I think I was expecting some kind of PW magic to kick in and inject the DefaultPage methods.

    Either way I know now and this awesome PW feature becomes even more useful. Thanks all. 🥳

     

    Edit: I now also realise this is exactly what @Charming Troll's reply was demonstrating. - thanks.

    • Like 3
  16. Hi all, sorry for the delay I was away for a few days and thanks for the responses so far.

    So the contents of the class file (DefaultPage.php) are as follows:

    class DefaultPage extends Page {
    
        public function test() {
            return 'test';
        }
    
    }

    My understanding (maybe wrongly) is that in this scenario $page->test() should then be callable in any template? However I get a method is not callable in this context error.

     

    On 8/21/2023 at 12:15 AM, wbmnfktr said:

    Is it enabled in your config.php?
    Just asking.

    $config->usePageClasses = true;

     

    Yes this is enabled. Testing this in a fresh download of latest production PW where is enabled by default. (Other template specific classes and methods work too - e.g. /classes/HomePage.php).

     

    Other background info is that I'm using markup regions - I don't know if that could make any difference?

    Thanks,
    J

    • Like 1
  17. Have been loving working with the custom page classes feature since it was added, but haven't yet figured out if there's meant to be a built in way to add a class in /site/classes that will add methods for every template rather than for a single template type.

    I thought initially you could add a function to

    /site/classes/DefaultPage.php

    and call it as

    $page->yourCustomMethod()

    within any template but this doesn't seem to work - is it meant to?

  18. Hey @Cybermano 👋 ... remember me! 🤣

    Sorry had a crazy few weeks at work and then a holiday, but finally got around to reviewing your great contributions on this module. I tested it and everything looks great. I merged your changes and also combined our readme files and added a thanks note/credit for you too 🙂

    Thanks again - you've taken this module way beyond where I originally planned.

    Only comment is I noticed when you first install it, the module will error on the front end because no languages are selected. I guess this is obvious when you think about it, but wonder if we should make that a compulsory field or pre-populate with at least one language?

    Thanks
    J

    (Finally changed my name on here too lol)

    • Thanks 1
  19. Hi @Cybermano - just to let you know I've seen your continued hard work on this module 🥳 which is awesome! I'm pretty sure it's all a million times better than my implementation but I've been so busy at work last few weeks I've not had a chance to review it all. I'll make sure I'm onto it this weekend and merge it all in.

     

    P.s. as you can see from my GH my real name isn't Guy (it was an obscure Simpsons reference)... I might change my name on here as it feels really silly otherwise 🤣🤣

    • Like 1
×
×
  • Create New...