500 error when using pdoPage and the ajax feature

Trying to load a migx using pdoPage and the first load works fine, but when I hit the load more button, it tries to fetch from the connector.php file in assets/components/pdotools/ and returns a 500.

The only error related to pdoPage in the log is about the $showLog variable being undefined. I’m also seeing a lot of “backtrack limit exhausted” messages but I’m pretty sure that is unrelated.

Here is the HTML:

<div id="pdopage" class=" py-1">
  [[!+page.btn]]
  <div class="rows">
    [[!pdoPage?
      &element=`getImageList`
      &tvname=`idea-migx`
      &tpl=`idea-main-tpl`
      &ajax=`1`
      &ajaxMode=`button`
      &limit=`5`
      &prepareTVs=`idea-migx`
      &ajaxTplMore=`blog-more-btn`
      &pageNavVar=`page.btn`
    ]]
  </div>
</div>

Let me know if there’s anything that needs answering!

500 errors are usually not logged in the MODX error log, but in the server log. Try to locate the PHP error log file (the exact path depends on the server settings) and check what message gets added, when you click the “Load More” button.

Okay, found it, turns out that the images are processed correctly the first time, but after hitting “load more” the path is messed up.

First time: assets/img/folder/file.jpg
Load More: folder/file.jpg

But with prepareTVs setting as it is in the example, that should be handled, I thought?

Is assets/img/ from a media source?
Where is this media-source defined? In the MIGX config? Or in the image TV that is used by MIGX?

On the migx tv using "sourceFrom":"migx"

prepareTvs is a property of the pdoResources snippet.
If you use getImageList you can’t use this property, as getImageList doesn’t process it.

I think it should work, if you instead use processTVs.

&processTVs=`1`

Weird, but i guess that makes sense, thanks for your help!!

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.