Jump to content

dragan

Members
  • Posts

    2,007
  • Joined

  • Last visited

  • Days Won

    21

Posts posted by dragan

  1. On 12/30/2019 at 11:02 PM, a-ok said:

    $session->redirect($url);

    $session->set("lucentLightingSessionRedirected", "true");

    Just a thought: Shouldn't you be setting the session first, and then redirect? (change order)

    Your $session->set() is probably never executed at all.

    On 12/30/2019 at 11:02 PM, a-ok said:

    == "false"

    Also maybe worth checking out: perhaps you need a === instead of ==.

  2. @Wanze

    Just a quick heads-up re: encoding issue: the fix by @tiefenb works in my setup (using the default PW multilang profile).

    (Previously, for every instance of "inherit default value" used, Umlaute were b0rked, while manually overwritten values were displaying OK.)

  3. 12 minutes ago, activestate said:

    You think i should use "pages" as categories and seems i'm almost done. Did you think about such approach ?

    Exactly. That's the preferred "PW way" to do such stuff. It may seem weird at first glance, but once you realize that in PW everything is a page (not just what you render as "page" in the frontend), you can do all kinds of stuff. Think of a PW-page as basically a container than can contain any kind of content, and can be cross-referenced and queried. Don't have time right now to point you to docs/more tutorials, sorry.

    I always create a dummy template "empty" (naming is up to you; it doesn't need a physical .php file, because it doesn't need to be viewable in the frontend) just for this reason: it has only a title field and nothing else. And you can re-use it as many times as you need, without creating more templates than needed. Just create a new parent page as container for every new category / attribute or whatever you're using it for, so you can reference it in your page reference selector. And with setups like that, if you rename a category, you don't have to update all instances manually (avoid redundancy etc.etc.)

    • Like 1
  4. I would choose a page reference field for your categories, instead of a select field. A select field is "static", i.e. you have to add/edit/remove categories yourself, and therefore need the necessary rights.

    With a page reference field, you can pre-define categories, and in the field-config allow users to add new ones.

    374541603_Screenshot_2020-01-03EditFieldkantonlocalhost.png.3b189be3098e7e2858e939c2ad11635c.png

    In case you didn't use page reference fields until now, I suggest you learn more about them. Here's a truly epic tutorial (old, but the fundamental logic still applies all these years later...)

    • Thanks 1
  5. @adrian Thanks! I guess I found it myself...

    My IDE was complaining that $owner was not defined in site/modules/TracyDebugger/panels/RequestInfoPanel.php line 596, so I added $owner = null; in line 551
    i.e. before if(function_exists('posix_getpwuid')) {

    Before that, I also removed phpstorm://open?file=%file&line=%line from the protocol handler in TD config (I never got it to work anyhow; probably a stupid Windows issue...)

    Not sure if the var init fix is a clever or stupid thing, but at least the errors are now gone.

  6. I just upgraded TD, and now I see this Tracy error on every page (FE + BE):

    Spoiler

    ErrorException: Undefined variable: owner in D:\laragon\www\pw\site\assets\cache\FileCompiler\site\modules\TracyDebugger\panels\RequestInfoPanel.php:596
    Stack trace:
    #0 D:\laragon\www\pw\site\assets\cache\FileCompiler\site\modules\TracyDebugger\panels\RequestInfoPanel.php(596): Tracy\Bar->Tracy\{closure}(8, 'Undefined varia...', 'D:\\laragon\\www\\...', 596, Array)
    #1 D:\laragon\www\pw\site\assets\cache\FileCompiler\site\modules\TracyDebugger\tracy-2.7.x\src\Tracy\Bar\Bar.php(149): RequestInfoPanel->getPanel()
    #2 D:\laragon\www\pw\site\assets\cache\FileCompiler\site\modules\TracyDebugger\tracy-2.7.x\src\Tracy\Bar\Bar.php(121): Tracy\Bar->renderPanels('')
    #3 D:\laragon\www\pw\site\assets\cache\FileCompiler\site\modules\TracyDebugger\tracy-2.7.x\src\Tracy\Bar\Bar.php(97): Tracy\Bar->renderHtml('main')
    #4 D:\laragon\www\pw\site\assets\cache\FileCompiler\site\modules\TracyDebugger\TracyDebugger.module.php(1733): Tracy\Bar->render()
    #5 D:\laragon\www\pw\wire\core\Wire.php(383): TracyDebugger->sessionHandlerDBAjaxFix(Object(ProcessWire\HookEvent))
    #6 D:\laragon\www\pw\wire\core\WireHooks.php(927): ProcessWire\Wire->_callMethod('sessionHandlerD...', Array)
    #7 D:\laragon\www\pw\wire\core\Wire.php(450): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessWire), 'finished', Array)
    #8 D:\laragon\www\pw\wire\core\ProcessWire.php(790): ProcessWire\Wire->__call('finished', Array)
    #9 D:\laragon\www\pw\wire\core\ProcessWire.php(591): ProcessWire\ProcessWire->__call('finished', Array)
    #10 D:\laragon\www\pw\wire\modules\Process\ProcessPageView.module(271): ProcessWire\ProcessWire->setStatus(128, Array)
    #11 D:\laragon\www\pw\wire\core\Wire.php(380): ProcessWire\ProcessPageView->___finished()
    #12 D:\laragon\www\pw\wire\core\WireHooks.php(823): ProcessWire\Wire->_callMethod('___finished', Array)
    #13 D:\laragon\www\pw\wire\core\Wire.php(450): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessPageView), 'finished', Array)
    #14 D:\laragon\www\pw\index.php(56): ProcessWire\Wire->__call('finished', Array)
    #15 {main}

    I've deleted the assets/cache/ folder several times, refreshed modules etc., but the error persists.

    I don't know if it matters, but I've upgraded Tracy with Module Toolkit (only discovered and used for 1-2 days, and so far working flawlessly).

    Other infos:

    ProcessWire: 3.0.147
    PHP: 7.2.19
    Webserver: Apache/2.4.35 (Win64) OpenSSL/1.1.1b
    MySQL: 5.7.24

     

    • Like 1
  7. So, for the first time ever, I am trying to use the Webp feature. Alas, no luck.

    ProcessWire: 3.0.147
    PHP: 7.2.19
    Webserver: Apache/2.4.35 (Win64) OpenSSL/1.1.1b
    MySQL: 5.7.24

    I used the .htaccess method. I tried with FF + Chrome. I created new images, de-activated Pro Cache.

    I have added this to site/config.php:

    $config->contentTypes('webp', 'image/webp'); // seen elsewhere in a forum thread

    + these lines at the top of my .htaccess:

    <IfModule mod_mime.c>
      AddType image/webp .webp
    </IfModule>

    Still, no Webp images are generated (assets/files/123/ only has JPG versions) or shown in the browser. The mod_mime Apache module is definitely loaded, and I have restarted the server.

    What else do I need to check?

     

  8. @Vigilante That's exactly where (the often overlooked) Pro field "Functional Fields" shines. It does exactly what you are looking for.

    https://processwire.com/blog/posts/functional-fields/

    Or you could use the Textareas field: https://processwire.com/store/pro-fields/textareas/
    The big advantage is that no matter how many fields you are using, behind the scenes it always just counts as one single field.

    • Like 1
  9. I dont' get it either. Text and textarea fields don't "link to pages". In the fields "actions" tab, you can see in which templates your field is used. Do you mean this? And likewise, in the template settings ("basics" tab, at the bottom), you can see which pages are assigned to this template.

    If you mean "a shortcut to the field setting" from within the page editing area, then you should check out the Admin On Steroids module.

  10. So it turned out that the FTP extension wasn't loaded. After enabling it and restarting Apache / Laragon, everything works as expected. (with the earlier Duplicator version, however, no error message was shown) Thanks to @Autofahrn for the help.

    1 hour ago, Autofahrn said:

    Sorry, I somehow missed the FTP part since already the package build seems to fail.

    nope:

    15 hours ago, dragan said:

    Local backups work fine, but FTP does nothing.

    ?

    • Like 2
  11. 11 hours ago, Autofahrn said:

    What absolute path did you use?

    The absolute path of the remote destination server (where I want the backup to be stored via FTP).

    11 hours ago, Autofahrn said:

    Should equal whatever is stored in $config->paths->root to be located inside your webroot.

    Why is that? PW is not even installed on the destination server. I am talking about the field "FTP Settings: Upload directory: Directory on the server where the packages will be stored." Why is that supposed to be the same as my local path "D:/laragon/www/pw/"? That makes no sense.

    • Like 2
  12. Well, the first thing you should do is change

    <option value="">Any</option>

    to something like

    <option value="any">Any</option>

    Then you would at least get a parameter in PW that you could act upon.

    Before you run your
    foreach(array('beds', 'bathrooms', 'size') as $key) {
    routine, I would check if all of those three parameters are set to "any" (or whatever you choose to use), and if that's the case, skip the entire foreach() and go straight to the "full search".

    • Like 1
  13. Is "any" an actual form item (checkbox, radio button...) ? If it was, then you would see it in the query parameters as well (e.g. /?beds=&bathrooms=&size=&any=1&submit=), and could easily add it to your selector query logic.

    If "any" just means that neither beds, bathrooms nor size was selected by the user (which your posted GET example suggests), you would have to account for that scenario, and check for the absence of parameters, and thus send another search selector to PW.

    11 minutes ago, jds43 said:

    I hope this isn't too vague.

    If you could post the relevant code, it would sure help.

  14. @flydev I installed Duplicator today (ATO version). Local backups work fine, but FTP does nothing.

    In the log I just see:

    Quote

    2019-12-30 22:25:14:  - package build failed.
    2019-12-30 22:25:14:  - package build failed,  doesn't exist

    What exactly "doesn't exist"? I have entered /public_html/pwb in "upload directory". This folder definitely exists, and the FTP credentials are correct. Any pointers where to look? Do I have to enter server path without leading / ? Something else I missed?

    • Like 1
  15. On 12/27/2019 at 11:28 PM, ryan said:

    LoginRegisterPro

    @ryan

    Are there any plans to include SSO features in LRP? e.g. allow a new user to sign up with his Github/Google/FB/Twitter... account?

    Single-sign-on registration / login can (at least in some use-cases) significantly optimize onboarding. I certainly wouldn't see it fit for new superusers, but for any other kind of custom-defined user-type, it would be a very cool feature to have.

    If there are currently no such plans, how complicated would it be to add SSO to LRP? Would it be possible with hooks?

    • Like 2
  16. If you choose the self-hosted app, it's a one-time price tag of USD 275. Compared to the cloud solution pricing, that's a fair price (the 6 month renewal is optional; you can continue to use the software, but don't have access to upgrades etc.)

    The thing with push is: It's not trivial to set up yourself. I'm not sure you'll find an open-source (or free) forum that contains that feature as well.

×
×
  • Create New...