Jump to content

adrian

PW-Moderators
  • Posts

    10,741
  • Joined

  • Last visited

  • Days Won

    345

Posts posted by adrian

  1. Not sure what you are making work via Admin > Access > Users, because to get BCE to work here like that, I need to replace line 185 with:
     

            if(!$this->data['allowAdminPages'] && (!in_array($this->editedPage->id, $this->wire('config')->usersPageIDs) && ($this->editedPage->template->flags & Template::flagSystem))) return;

     

  2. I wish the sidebar actually worked well - I had hight hopes for that feature, but it just doesn't really work. Just in case you haven't ever noticed, the tree icon at the start of the breadcrumbs brings up a panel overlay with the full menu which is a really nice feature. That, together with Robin's BreadcrumbDropdown menu and life is pretty good.

    AdminOnSteroids does have a sticky header feature.

    • Like 1
  3. Hi @bernhard - I think the easiest way might be to set: Debugger::$editorMapping which I think you should be able to change in config.php

    Here is where the path is built: https://github.com/adrianbj/TracyDebugger/blob/f2fbcd88fcecad45b2ce7b428cfe80c1527c1122/TracyDebugger.module.php#L1004-L1048 but I think in your case you will want to get the current value of Debugger::$editorMapping and do a str_replace on the path set in the module setting to adjust for each user as needed. You could probably even just put a placehholder like "localpath" in the module settings and replace that with the correct path per user.

    Let me know if that works out for you.

     

    • Thanks 1
  4. It works to allow the user to do the rating - perhaps you're not loading all the required assets?

        <link href="/site/modules/FieldtypeStars/InputfieldStars.css" rel="stylesheet" />
        <script src="/site/modules/FieldtypeStars/rater-js/rater-js.js"></script>
        <script src="/site/modules/FieldtypeStars/InputfieldStars.js"></script>

     

  5. Hi Marty,

    I think the problem is that you don't want to protect the page that is using the portfolio template. And as I mentioned above you also don't want the if($page->protected)  check.

    What you want is to protect the pages that have the images you're trying to restrict access to (using the option on the settings tab). Everything else will be taken care of by the module.

    Hope that gets you going and sorry if the instructions aren't clear.

  6. Good point about the translation of "copy". 

    As for the duplicate issue - I just tested here and uninstalling the module didn't completely prevent duplicate names. I think issue you saw might be related to pages created when you were experimenting with the Pages:cloned hook code I posted above. But please let me know if you see the problem once all those versions are removed and you're start with a fresh set of clones.

  7. Try this as a replacement for https://github.com/adrianbj/PageRenameOptions/blob/8665aca5023417163841603fda8037df2ccbe245/PageRenameOptions.module#L106-L108

    Not well tested yet, but wanted to give you a better idea of what I meant.

            preg_match('/\(copy\s?\d?\)/', $p->title, $matches);
            $isTitleCloned = !empty($matches) && $p->name != $this->wire('sanitizer')->pageName($p->title, Sanitizer::translate);
            if(!$isTitleCloned && $this->data['initialDifferencesProtected'] && !$this->wire('user')->roles->has("name=".implode("|", $this->data['exemptRolesInitialDifferencesProtected']))) {
                $this->wire('config')->scripts->add($this->wire('config')->urls->PageRenameOptions . "InitialDifferenceProtected.js?v={$version}");
            }

     

    • Like 1
  8. What about if the module were to just disable the Initial Differences Protected check if the name doesn't match the title but the title contains (copy\s?\d?\) which would match (copy), (copy 2), etc. I think this approach will work better. Thoughts?

  9. Hi @Robin S - sorry for the really late response.

    Looks like your suggestion for matching the cloned name to its title works for me. Would you mind testing at your end please. Just add this at the start of the ready method.

    // if cloning a page, then set the name to match the title so Protect Initial Differences works
    $this->wire()->addHookAfter("Pages::cloned", function($event) {
        $p = $event->arguments(1);
        $p->setAndSave('name', $this->wire('sanitizer')->pageName($p->title, Sanitizer::translate));
    });

    This approach also works when the copy button allows one step ajax cloning.

    I'll look into your sync button idea as well.

    • Like 1
  10. 6 hours ago, LAPS said:

    Hi @adrian, thanks for the support.

    1. I (and I think almost any developer) am a bit reluctant to change the source code directly. It should work as-it-is.
    2. The enablement of the "Rename on Save" option helps with LoginRegisterPro (LRP). However, I find it a bit negative for performance reasons in addition to breaking file links.

    Can we expect in a future release of the module to allow selecting the user template and renaming LRP profile image just on upload?

    1) That was just to get you going - I'll make the change but I was hoping to hear back about LRP to see if I could fix that for you at the same time before committing a new version.

    2) Because I don't have LRP I can't test with it to figure out why it's not working, but if someone who does have it can figure out the issue and provide a fix I'd be happy to include it.

  11. Hi @Marty Walker - hope you're well!

    I think perhaps you don't quite have things right, but I am really guessing at this point. Keep in mind that if you want to embed into the site you need a dedicated template as defined in the settings and you shouldn't need the if($page->protected)  check.

    image.thumb.png.59c159a6ecb6f7e21b5d5ef15b70f054.png

    Does that help at all, or am I missing the point entirely?

  12. Hi @LAPS - I just tested here and even though currently it's not possible to select the user template, if you don't select any, the module does work on the user template. BTW - it would be trivial for me to allow selecting the user template - for now you can enable by changing line #736 to:

    if($currtemplate->name != 'user' && ($currtemplate->flags & Template::flagSystem)) continue;

    I don't have access to LoginRegisterPro so I am not sure about that but the module does work with uploads via the API so I would have thought it worked. Does the "Rename on Save" option help?

  13. 18 minutes ago, gebeer said:

    I need this as a standalone module because we want to have different targets to report to based on error levels

    That could be built into Tracy if you want it. Currently the email logging is just all error levels to all listed email addresses, but I am sure we could support different levels per email. Up to you of course but it just feels like a good fit to me.

    Excited to see what you do either way.

    • Like 2
  14. Hi @gebeer - the Tracy core handles this via PHP's set_error_handler (https://github.com/nette/tracy/blob/f9645299229878a61b46baa82ff61d8a739bccf8/src/Tracy/Debugger/Debugger.php#L226)

    Looking at what your trying to do here, can I suggest that you extend Tracy rather than creating a new module. Recently I added the ability for Tracy to log to Slack (https://github.com/adrianbj/TracyDebugger/blob/3185ec827c001c0c310cb9b13558ca3e53eabbc5/includes/SlackLogger.php) and use different icons based on the error level, eg:
    image.thumb.png.123317c4dbee68599150fa5902053cb1.png
    so you should certainly be able to do something similar for Rollbar. I feel like most PW users make use of Tracy and this would just help to make it better without needing a separate module.

    You might find some further inspiration in the panels that add support for monolog that you can find here: https://componette.org/search/tracy

    You might find this useful: https://tracy.nette.org/en/recipes#toc-custom-logger although keep in mind that I had issues with that approach in that I couldn't get it to also support emailing errors at the same time

    Let me know if you have any other questions.

    • Like 3
  15. But pageClass doesn't work on pages. I see you're calling it on $template though. So I think we want to populate "class" on both the page and template info sections which required different approaches. Please try the attached and let me if you're getting what you need in the Page Info and Template Info sections.

    RequestInfoPanel.php

    • Like 2
×
×
  • Create New...