Jump to content

prestoav

Members
  • Posts

    221
  • Joined

  • Last visited

Everything posted by prestoav

  1. Hi Robin, actually this solves the issue nicely going forward. Thank you.
  2. As part of site development I somethings need to change crop sizes / settings in the codebase after the client has started to add content. This means I can end up with a lot if image variations having been created (and still being used) but with old settings. A good example might be an image variation that was created using a quality of 50 but now the code is set to 100. A new variation is not created under these situations, only if the variation size is changed. So, is there a way to purge all variations leaving the original uploaded image so new variations can be created at page runtime? I have tried the 'PageimageRemoveVariations' module (later v4 version) but that doesn't seem to remove images that are in repeater fields or RepeaterMatrix fields. I'm guessing a solution might have to work at a file level rather than field level? Any help here would be appreciated!
  3. Is there a way to configure this module so that a 'no cookies at all' options is available? This would need to mean the wire cookies are also not loaded. Asking for a client!
  4. Thanks for your help @ryan. I checked the admin template and segments were not allowed (I assume this is the default as I didn't even know this section of admin existed)! I also checked my MAMP copy of eth site and that does not have segments allowed either and that's working fine. I've allowed segments on the live site (the one with the issue, see config image below) but the problem remains: I did look at the browser Network tab and only two redirects were noted (see original post). Looking further at where the issue happens, when I login to the MAMP site (that works) the page you get to is '/admin/page/?login=1'. However, on the version of the site that is live the login process directs you to '/admin/template' which, I'm guessing is where the issue is? Another thing I've noticed with further investigation is that, if I switch to the Reno or Default themes the 'Pages' menu is completely missing. It's there in UiKit but not in the others. Again, checking my local copy of the site, the Pages menu is present in all themes?
  5. Hi folks, PW 3.0.210 PHP 7.4.33 DB MariaDB I know others have had similar issues with this error displaying and I have worked through all proposed solutions (I think....). Here's the issue, on admin login I see this error: Looking at the network tab of browser tools I only see 2 files which are not status 200 when login has completed: I also see the issue when trying to delete pages either via the Lister (Find) or in the page specific admin (example here from Lister after the 'Trash' button is clicked in Pages > Find - note I do not have ListerPro installed). Thsi means I can no longer delete pages in admin! There are no errors in console and no errors in PW logs or the hosting's PHP log file. Finally, deleting pages via the API completes with no issues or errors. To try and diagnose the situation further I have also: 1) Installed a brand new version of the whole 'wire' folder 2) Brought in a known-working, version correct, version of the .htaccess file with only the no.9 'https' directive active. 3) Checked there is a valid 'Profile' page under Admin in the page tree and that page has the correct 'ProcessProfile' Would any of you super people out there have any other ideas I could try to correct this? Thanks in advance!
  6. Hi @BitPoet, Many thanks for this. The $urls->assets issue was the problem here. I didn't understand the difference between this and the $config->paths one so that's something new I've learned. Thanks!
  7. Hi all, PW 3.0.210 PHP 7.4.21 I'm trying to use WireUpload for the first time to upload an image to an existing multi-image field on a existing page but no image is uploaded to the temp path or the page itself. Here's my code which is based on suggestions from other posts: // Set File Extensions $fileExtensionsAllowed = ['jpeg','jpg', 'JPEG', 'JPG', 'png', 'PNG', 'gif', 'GIF']; // Set upload path $upload_path = $urls->assets . "cache/temp_image_uploads/"; $p->of(false); // New wire upload $img1 = new WireUpload('img1'); $img1->setMaxFiles(1); $img1->setOverwrite(true); $img1->setDestinationPath($upload_path); $img1->setValidExtensions($fileExtensionsAllowed); // execute upload and check for errors $imgs = $img1->execute(); // Run a count($files) test to make sure there are actually files; if so, proceed; if not, generate getErrors() if(!count($imgs)) { echo "Sorry, but you need to add a photo!"; return false; } // Run photo upload foreach($imgs as $filename) { $pathname = $upload_path . $filename; $p->product_images->add($pathname); unlink($pathname); } // Save page $p->save(); $p->of(true); $p is the page that the field is present on and $->product_images being the field the image is to be uploaded to. At this time the intention is to upload just one image file, even though the field will take multiple images. The upload directory definitely exists and when I run a print_r($_FILES) after form submission (before the code above) a file with the name attribute 'img1' is present in the $_FILES array. When this code runs the "Sorry, but you need to add a photo!" error is seen and a the $imgs variable is empty. There is nothing in the PW logs or MAMP PHP error logs reported. Does anyone have any idea what I might be doing wrong here? Thanks in advance for any pointers!
  8. Hi again, Many thanks for your hints, with your help I think I have tracked down the original issue. I copied in a new version of the Procache directives tot he .htaccess file recently and that seems to be the issue. I may have copied them incorrectly so I'm not saying it's the code but reversing to an older version of the .htaccess resolved the Lister issue. The login issue 'Unrecognised path' still remains though. Thanks for your help and the hint in the .htaccess date change!
  9. @BrendonKoz Thanks for you reply. I did check the logs and they were all clear. Checking the console though (I really should have thought of that...) did reveal a 404. However, the file that report as a 404 is /admin/page/lister:1 which is the page itself rather than a recourse file. Just to be sure, I have also now replaced the entire wire directory with the one from my local copy which works just fine by the issue remains. I've now found another new issue. When first logging into admin I get this error: If I then go to the page tree things go back to normal?
  10. PW: 3.0.210 Lister: 0.2.6 PHP: 7.4 One of my sites has stopped displaying any results with the Pages > Find function in admin. This is a new thing without doing any code or module updates as far as I can tell so possibly a hosting change has brought it about. It doesn't matter what I search for (or even if no terms are filled out) I get the same error - 'Error retrieving results: [object Object]' Has anyone else encountered this and / or have any ideas as to how to fix it? Thanks in advance!
  11. Thanks for the great module! Sadly, I'm now seeing error after updating my MAMP install to PHP 8.0.8. See errors below, other versions numbers for this install are: PW 3.0.200 VersionControl 2.4.0 / VersionControl Cleanup 1.0.0 - this error doesn't occur with VersionControl 1.3.5 without the cleanup module. Errors on admin pages: Warning: scandir(db/variations): Failed to open directory: No such file or directory in .../site/modules/VersionControl/VersionControlCleanup.module on line 117 Warning: scandir(): (errno 2): No such file or directory in .../site/modules/VersionControl/VersionControlCleanup.module on line 117 Warning: foreach() argument must be of type array|object, bool given in .../site/modules/VersionControl/VersionControlCleanup.module on line 118 Warning: scandir(db/): Failed to open directory: No such file or directory in .../site/modules/VersionControl/VersionControlCleanup.module on line 124 Warning: scandir(): (errno 2): No such file or directory in .../site/modules/VersionControl/VersionControlCleanup.module on line 124 Warning: Cannot modify header information - headers already sent by (output started at .../index.php:55) in .../wire/core/WireHttp.php on line 1688 Error trace box content: Look out… Fatal Error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in site/modules/VersionControl/VersionControlCleanup.module:124 #0 site/modules/VersionControl/VersionControlCleanup.module (124): count(false) #1 site/modules/VersionControl/VersionControlCleanup.module (95): VersionControlCleanup->cleanupFiles() #2 wire/core/Wire.php (417): VersionControlCleanup->cleanup(Object(HookEvent)) #3 wire/core/WireHooks.php (1062): Wire->_callMethod('cleanup', Array) #4 wire/core/Wire.php (485): WireHooks->runHooks(Object(LazyCron), 'everyDay', Array) #5 wire/modules/LazyCron.module (198): Wire->__call('everyDay', Array) #6 wire/core/WireHooks.php (1059): LazyCron->afterPageView(Object(HookEvent)) #7 wire/core/Wire.php (485): WireHooks->runHooks(Object(ProcessPageView), 'finished', Array) #8 index.php (56): Wire->__call('finished', Array) #9 {main} thrown (line 124 of site/modules/VersionControl/VersionControlCleanup.module) Seems to refer to this line (124 of the Cleanup module): if (count(scandir($dir)) == 1) wireRmdir($dir, true); Sadly my knowledge / understanding of what's going on ends here but hoping it can be fixed or it is something else in my install.
  12. Hi @Robin S thanks for your input here. You were right, for the admin lister to work for editor logins looking to find unpublished pages the following is needed: 1) The template must have explicit edit access for editors, not access settings inherited from a parent template 2) The template must be specified in the search alongside the 'Status has Unpublished' rule The requirement for explicit access settings seems a little overbearing to me. If a user has inherited access to create and edit pages using a specific template then it seems sensible that those privileges shouldn't be limited by Lister. I think they should be able to find them in Lister without the template having explicit settings for access. From a UX point of view I think the current situation is misleading, especially as searching for hidden pages does work in the same scenario. Thank you again for you input. This has meant a working solution for the client which is the important bit!
  13. For some more info, I've attached a small truth table as to what is possible in the page lister for the editor in question (first Lister filter set to template = template editor can edit). It shows that, although the 'hidden' filter works ok when used independently, setting the page to 'Unpublished' means they don't show when the page is unpublished and this overrides the 'hidden' filter too so that pages that are both hidden and unpublished are not listed, even when the page is set to hidden and the filter is set to show pages that are hidden. Again, any help is really appreciated.
  14. Well actually, it sadly doesn't seem to always work... This method worked on one of my sites but on a sister site (a near identical site actually) it doesn't work for one particular template. It does work on the previous site (same template structure). Looking at the template in question, neither it or its parent have any access control restrictions and the user is free to edit that page and its parent. Anyone have any experience of this or further suggestions? All help appreciated as always!
  15. Hi Adrian, I tried adding his to ready.php bug got this error when logged in as an editor: No templates specified so 'include=hidden' is max allowed include mode Hi Robin, Yes, this does work, thank you.
  16. Hi all, PW 3.0.200 It seems a user with editor permissions can't list unpublished pages (even if they themselves created them) in the lister within the admin > pages > find function. Superusers can see them but editors can't. Having searched the forums I can only see fixes for page select fields using hooks but nothing that would allow a permission for this to be granted. This is quite an issue for a couple of sites I have. For example, a manufacturer who needs to administer a list of their resellers (all have separate pages) that needs to be turned on / off regularly. There are well over 1k reseller pages so the find function is a god-send for this type of thing. Does anyone have a way around this or a way to set this as a permission that can be granted? Is this feature available in ProLister perhaps? If this can't be easily changed maybe this option should be greyed out in the admin page lister for editor type users? All help very gratefully received!
  17. Hi @Guy Incognito, thanks for replying. In the short term it looks like the current client might be moving away from Zoho so we've paused further development for now. However, I know some of our other clients still use Zoho so I may be back in touch at some point if that's ok!
  18. Hi all, Has anyone produced a module for integration with the Zoho CRM? My client uses this in their business and they'd like to automatically send contact form entries (using FromBuilder) to the Zoho account for storage and action as a 'lead'. Zoho does offer email parsing. However, the clients account level doesn't include that ? Any help or information greatly appreciated!
  19. @Robin S Ah ha, nailed it! My bad for not reading that part of the description. Now changed to checkboxes and it's working a charm. Thanks again for your help. Seriously useful!
  20. Hi @Robin S, Many thanks. This has cured the saving error for sure. It doesn't address the full tree being shown when you go to select a page but I'm not sure that's even possible. Again, every day is a school day. I had seen and used the 'page.field' format in selectors before but not the 'page.page' one. I also wasn't aware that '$page' could be substituted with 'page' in these selectors so thanks for that lesson too! G.
  21. Hi @elabx, Thanks so much for showing these examples I'm not great with page hooks yet but I'm getting there. I'm going to look deeper into you examples and have a play!
  22. Hi all, I'm building a categorised FAQ section for a site with the following structure: -FAQ Page (template = faq-parent) -- Category 1 (template = faq-category) -- Category 2 (template = faq-category) etc. -- Questions (template = faq-articles) --- Question 1 (template = faq-article) --- Question 2 (template = faq-article) etc. The 'Questions' page is a container for all the actual question pages (articles) to make admin clearer as there are likely to be 100+ question pages / articles. I'd like to make the system so I can duplicate it elsewhere in the same website as we might have more than one FAQ section using the same templates and page structure. Each article has a page reference field where the editor can choose one or more categories for the article to be listed under. So, to ensure flexibility, I'd like this field to only select from categories that are under the main 'FAQ' page grandparent of the actual article. This would ensure that a second FAQ section would not conflict with the first. Setting up the page reference field for the article category I would usually set parent and template in the 'Selectable Pages' fieldset. However, setting the parent would restrict the flexibility of the system to just this FAQ section (because the parent is pre-set). So, trying to use the 'Selector String' method I added the selector: template=faq-category, parent=$page->parent->parent, sort=sort But I get this error when saving an article page with a chosen category: PagesEditor: Error saving field "Categories this question is displayed in" — Unrecognized operator: $ Also, when selecting the category on the article page, the whole page tree is displayed rather than the sub set of pages found by the selector. Does anyone have any ideas how this might be done or will I need to leave the field selection open for any page? All thoughts gratefully received!
  23. Hi Zeka, Thank you for the suggestion. Sadly that just gives a blank array and the error 'Notice: Array to string conversion'. Stay safe my friend.
  24. Hi all, PW 3.0.184 On trying to diagnose a form issue it's become clear that the PW $session array is empty. $_SESSION has data in it but PW's own $session variable is empty, not even the User ID is there? For example adding this at the top of any page: <?php print_r($session); ?> Results in this: ProcessWire\Session Object () But this: <?php print_r($_SESSION); ?> Outputs user and other data. I'm trying to use some data that woudl be way easier using PW's $session and am drawing a blank. Grateful of any ideas or past experiences which may help diagnose this!
×
×
  • Create New...