Jump to content

lpa

Members
  • Posts

    202
  • Joined

  • Last visited

Posts posted by lpa

  1. The problem seems to be when the database has an empty description field which is returned as an array on line 429:

    $description = wireDecodeJSON($item['description']);

    With TracyDebugger bd($description) I get: Array

    Before line 452

    $description = $sanitizer->entities($description);

    bd($description); gives: "Array" 

    And after the sanitizer

    bd($description); gives: array-0

     

    • Like 1
  2. First of all, the images field is inside a repeater. But I don't think that is a problem.

    In addition to the four different formats you show above, for some reason I have just the text in the description field, the last one. But I don't know why is that even possible, as it does not happen if I save a new description.

    It might be, that the language support was added later and the old descriptions are not converted to the JSON format. This is not a big issue for me. I just happend to notice that there is some weird behaviour. 

    image.png.c72cc27c695caf6c35f8b382e5e7d89d.png

    At least you could check that the empty description fields would not be shown as "array-0":

    image.png.eeaddfd9cfd83471d71b5e8b4ac793bc.png

    • Like 1
  3. Great module, thank you!

    One small problem: I have a two language site. The description field having some text shows not the text, but this: array-0. The text of the description field is not found with the search-box or Custom Search Builder, but it can be search with the filter part above.

    Is this a limitation of the multilanguage fields or a bug?

    • Like 1
  4. Thanks @ryan!

    So the region has to be the same tag as the insertion?  

    I wanted to create a pw-region inside <head> to know exactly where the scripts are inserted. How should I then insert the scripts in the pw-region -tag? I don't understand what would then be the correct way to use the <pw-region> or <region> tag that is described in the documentation here: https://processwire.com/docs/front-end/output/markup-regions/

    The main question in my situation is how should I insert the JavaScript and CSS links from a RepeaterMatrix field in to the <head> and in a correct position. 

  5. I have problems putting a Markup Region action inside a Repeater Matrix field template. I am trying to get a region be appended in a region defined in <head> like this:

    _main.php head has this:

    <head>
      ....
    <pw-region id="mainhead">
    </pw-region>
      ....
    </head>

    And my Repeater matrix field has this:

    <div id="mainhead" pw-append>
    	<?php echo $form->styles; ?>
    	<?php echo $form->scripts; ?>
    </div>

    The problem is that the contents of the matrix field action region is not put in the <head> of the page but in place it is in the Repeater Matrix template. 

    Is this supposed to work?

  6. In one use case we have a normal cache like this

    $local_data = $cache->get('calendar', $c, function() { }

    With PW 3.0.184 setting expire argument ($c) to -1 the cache was cleared. Now it does not work and trying to set expire argument to 0, we get '0000-00-00 00:00:00' in the database expire field instead of some valid date. 

    What is the correct way to expire the cache by setting the expire argument OR should we always use $cache->delete('calendar') to expire now?
     

  7. Hello

    I have sometimes problem with a PW-site where mysql is stuck with a lot of processes in a state: "Waiting for table level lock". The whole site goes down with that problem as the queue of free PHP processes is used before the database locks are released. 

    Has anybody had the same problem? Where to look at for the reason of the locks? How to debug this?

  8. On 3/8/2022 at 8:25 AM, kongondo said:

    Where do you store the article during the editing phase? I am assuming an article can be in this phase for more than a day.

    The articles are edited in an editorial system and we only want to preview them before they are finally ready to be published. Bernhards advice on using Nette was the chosen solution for us. 

  9. We need to create a preview of a page with data retrived through an external api without saving the page. The page consists of text, images and embeded HTML-items (youtube video, twitter feed-item etc). The preview is never saved as a page as it is only for preview purposes. 

    Is it possible to create a new PageImage object in the memory, do cropping and resizing and show the new manipulated image on the preview page purely in memory? 

  10. 11 hours ago, lpa said:

    Yes, I found that out and it fixes the problem. But the next problem is that no sitemap.xml is generated and no options are shown in the templates settings for the sitemap. 

    Well, now it works. I was expecting a file to be generated in the root, but then I realised it is dynamic. When you access domain.com/sitemap.xml, it is generated on the fly. 

    Now my only concern is if I check the "Include hidden or unpublished pages", are really all the hidden and unpublished pages included? If I have some pages hidden because they won't be in the main navigation, I would like those to be included in the sitemap. But never any unpublished pages. 

  11. I tried to install this module for the first time, but it gives me this error, when saving the settings:

    Fatal Error: Uncaught TypeError: Return value of MarkupSitemap::removeSitemapCache() must be of the type bool, null returned in site/modules/MarkupSitemap/MarkupSitemap.module.php:257
    

    And no sitemap.xml file is generated. 

×
×
  • Create New...