Jump to content

dynweb

Members
  • Posts

    85
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by dynweb

  1. Hi Robin,

    With the module installed, when I want to edit an image (e.g. crop) in admin, I get the following exception on clicking the "Apply" button:

    image.thumb.jpeg.be943bb384f08e7dda252732dda72234.jpeg

    The exception also occurs if I have previously generated all delayed images with the option "Generate queued variations". The error does NOT occur after uninstalling the module.

    Any ideas? Thanks 🙂

    • Like 1
  2. Hi,

    I'm using your module for the first time, looks really promising 🙂

    It seems that password fields *always* show a password toggle, even if the showPasswordToggle() method is not called in user code.

    In InputPassword.php, line 105, it unconditionally appends the checkbox:

    $this->append($this->showPasswordToggle()->___render());

    My solution was the following, but not sure if that won't break other things:

    // InputPassword.php
    
    // Line 26
    // protected InputCheckbox $showPasswordToggle; // The password toggle checkbox object
    protected bool $showPasswordToggle = false;
    
    // Line 85
    // $this->showPasswordToggle = $toggle;
    $this->showPasswordToggle = true;
    
    // Line 105
    // $this->append($this->showPasswordToggle()->___render());
    if($this->showPasswordToggle) {
    	$this->append($this->showPasswordToggle()->___render());
    }

     

    • Like 1
  3. I would add a new field with your requirements and migrate the contents from the "old" to the "new" field. Here is how I did it for a migration from a single image ("image") to a multiple images ("images") field:

    $gearPages = $pages->find("template=products-view-gear, include=all");
    foreach($gearPages as $p) {
        if($p->image) {
            $p->of(false);
            $p->images->add($p->image);
            $p->save();
        }
    }

     

    • Like 1
  4. When editing a template like this:

    image.thumb.jpeg.7f2c94ab742641ef147b2107c53d04e4.jpeg

    • As long as a template does not define its own access rights, the option "Yes always, regardless of page status or access control" has no effect: it "sticks" in the admin interface, but the folder /site/access/files/XXX is not prefixed with a "-" and access control is not enforced. The file is delivered by Apache.
    • If the template defines its own access right, it works as expected (by me). The file is delivered by PHP.

    It this expected behavior? Is there some good reason why a template must define its own access rights to enforce access control to files?

    Thank you for your insights.

    Edit: Tested on latest PW stable, pristine install.

    • Thanks 1
  5. 1 hour ago, LMD said:

    Does Stripe allow sellers to charge the buyer's card when items are shipped (which could be several days/a week later) instead of immediately when an order is placed?

    You can choose on your implementation if you want to charge the user's card immediately ("capture") or only reserve the funds for later capturing (via Stripe admin or API).

    The only problem is that it doesn't make much of a difference to the user (Stripe event advises that many users won't see a difference on their CC statement between "reserved" and "captured" amounts). Even if an amount is "only" reserved, the client can no longer dispose of these funds.

    • Like 1
  6. 4 hours ago, adrian said:

    I like the idea, but the problem is that sometimes it seems like it's possible for Tracy to double load without the composer files, which is why this line was added in the first place. Maybe I need to install nette via composer myself and see if I can reproduce and come up with a better check.

     

    if(class_exists('\Tracy\Debugger', false) && Debugger::isEnabled()) return;

    Works for me. We just tell PHP to skip autoloading, so it will never know about the composer version.

    • Like 1
  7. 2 hours ago, adrian said:
    if(class_exists('\Tracy\Debugger')) return;

    Does that work for you with nette included via composer?

    Not really ? At this point, Debugger is probably not enabled, so no output at all.

    if(class_exists('\Tracy\Debugger')) {
    	\Tracy\Debugger::enable();
    	return;
    };

    This one works, but the Tracy bar has none of the ProcessWire specific info (as the init() method returns early).

    if(class_exists('\Tracy\Debugger')) {
    	$this->wire('session')->error('Cannot activate TracyDebugger because another version is already installed, maybe via composer?');
    	return;
    };

    This kind of error message, however, would be really helpful for people like me who don't remember the stuff they have in their vendor directory...

  8. 20 minutes ago, adrian said:

    It's still weird to me though because that new line I added should prevent Tracy being loaded a second time. Do you need that composer include, or can you remove it without affecting anything else?

    Seems as if Debugger::isEnabled() returns false after a fresh composer install so it can't prevent double loading.

    I just have to be careful not to require tracy/tracy via composer (or nette/nette that adds *all* packages), so this shouldn't be a major problem ? 

  9. OK, problem solved ?

    Tracy is working with a pristine PW install.

    All my "customized" installs have a vendor directory where I (previously) did a

    composer require nette/nette

    which also installs tracy in the vendor dir. And this version is loaded first, resulting in the "Cannot declare..." error. Thank you for your help, @adrian !

  10. Thank you, @adrian

    I can reproduce the error on my local dev server and on the live server(s).

    I already tried to to refresh modules and to clean the file compiler cache, to no avail.

    I still have to test it with a pristine processwire install, I will let you know...

  11. Starting with version 4.3.26, I get a compile error after installing/upgrading Tracy:

    Compile Error: Cannot declare interface Tracy\ILogger, because the name is already in use (line 16 of site/modules/TracyDebugger/tracy-2.9.x/src/Tracy/Logger/ILogger.php)

    It seems that this commit https://github.com/adrianbj/TracyDebugger/commit/10e1d3a28a2719d120325eaf4559505c3ebd98a9 is source of the error. When removing the line

    if(class_exists('\Tracy\Debugger') && Debugger::isEnabled()) return;

    everything is working again.

    Tested on PW 3.0.184 and 3.0.200. 

    Any input will be appreciated -- I have no idea where to start ?

  12. 57 minutes ago, teppo said:

    when a page is indexed, output formatting should be disabled, and thus this sort of problem shouldn't happen. ?

    This put me on the right track ? I had a Pages::saved hook that set output formatting to true (when it shouldn't). Thank you!

    • Like 1
  13. 1 hour ago, teppo said:

    Actually it sounds like your search_index field could be single-value textarea, instead of textarea (multi-language). If so, you'll have to change the type of the field manually.

    It is multi-language.

    As far as I understand, $page->get($field) returns the field value (a string) if output formatting is true, and a field object if output formatting is false (what we need here).

  14. Using the module on a multi-language site. When saving a page, I get the following error: "Call to a member function setLanguageValue() on string", File: .../modules/SearchEngine/lib/Indexer.php:99

     98:                        if ($index_field_exists) {
     99:                            $page->get($index_field)->setLanguageValue($language, $index[$language->id]);
    101:                        }

    I suppose we need a $page->of(false) here before calling setLanguageValue() ?

  15. Hi @kongondo,

    On 2/27/2020 at 2:43 PM, Stefanowitsch said:

    I just installed the Media Manager on a clean PW installation and encountered a problem: Multiple image upload is not working.

    I am unter the "upload" tab and drag some images into the field. Then click "start". The upload progress bar is growing for 1 second then suddenly it shrinks back to zero and the image upload list is cleared. No images were uploaded. What is wrong?

    I'm encountering the same problem as @Stefanowitsch on the latest Media Manager: Multiple image uploads not working, exactly how he described it. Did you find a solution?

    Quote

    Second - whenever I alter something in the "settings" tab it is NOT saved. For example: Upload mode -> Single file uploads set to false.

    I do *not* experience this problem, so it may be unrelated...

    Thank you ?

×
×
  • Create New...