Can't get working pagination: An exception has been thrown during the rendering of a template

Hi!
I’ve two problems with pagination implementation.

  1. Error

I’ve set pagination for a blog. The all settings seems to be default except blog’s url, it’s the same as folder’s name - atlikti-darbai.

Once I try to open other pagination’s page I get this error:

Server Error

Sorry, something went terribly wrong!

### 0 - An exception has been thrown during the rendering of a template ("array_replace_recursive(): Expected parameter 2 to be an array, string given").

Templates has been overridden.

Blog.md

---
body_classes: 'header-image fullwidth'
twitterenable: false
twittercardoptions: summary
articleenabled: false
productenabled: false
blog_url: atlikti-darbai
content:
    items: '@self.children'
    order:
        by: date
        dir: desc
    limit: 5
    pagination: true
---

blog.html.twig

{% embed 'partials/base.html.twig' %}

    {% set collection = page.collection() %}
    {% set base_url = page.url %}    

    {% if base_url == '/' %}
		{% set base_url = '' %}
    {% endif %}


    {% block content %}

    {{ page.content }}
		<section class="container-fluid">
			<div class="row">
				<div class="col-md-8">	
					{% for child in collection %}
						{% include 'partials/blog_item.html.twig' with {'page':child, 'truncate':true} %}				
					{% endfor %}
				</div>
				{% include 'partials/blog_sidebar_footer.html.twig' %}
			</div>
		</section>
        {% if config.plugins.pagination.enabled and collection.params.pagination %}
			{#% include 'pagination.html.twig' with {'pagination':collection.params.pagination} %#}
			{% include 'pagination.html.twig' with {'base_url':page.url, 'pagination':collection.params.pagination} %}
        {% endif %}

        
    {% endblock %}

{% endembed %}

pagination.html.twig

{% if pagination|length > 1 %}
{% if base_url == '' %}
    {% set base_url = '/' %}
{% endif %}
<div class="blog-pager" id="blog-pager">
    <div class="pagenavi">
    {% if pagination.hasPrev %}
        {% set url = (base_url ~ pagination.params ~ pagination.prevUrl)|replace({'//':'/'}) %}
        <a rel="prev" href="{{ url }}">&laquo;</a>
    {% endif %}
    {% for paginate in pagination %}
        {% if paginate.isCurrent %}
            <span class="current">{{ paginate.number }}</span>
        {% elseif paginate.isInDelta %}
            {% set url = (base_url ~ pagination.params ~ paginate.url)|replace({'//':'/'}) %}
            <a href="{{ url }}">{{ paginate.number }}</a>
        {% endif %}
    {% endfor %}
    {% if pagination.hasNext %}
        {% set url = (base_url ~ pagination.params ~ pagination.nextUrl)|replace({'//':'/'}) %}
        <a rel="next" href="{{ url }}">&raquo;</a>
    {% endif %}
    </div>
</div>
{% endif %}
  1. URL

Also URLs are pre-rendered with this parameters: page:2, how it could be changed to page2 ?

I’ve forgot to post blog_item.htm.twig
The debugger points to these lines:

    {% if page.header.continue_link is sameas(false) %}
    {{ page.content }}
    {% if not truncate %}

<div class="post">
  <div class="entry-container">
    <div class="entry-content">

      {% if page.header.link %}
      <h1 class="entry-title">
        {% if page.header.continue_link is not sameas(false) %}
          <a href="{{ page.url }}"><i class="fa fa-angle-double-right"></i></a>
        {% endif %}
          <a href="{{ page.header.link }}">{{ page.title }}</a>
      </h1>
      {% else %}
      <h1 class="entry-title"><a href="{{ page.url }}">{{ page.title }}</a></h1>
      {% endif %}
      {% if truncate %}

        <div class="meta">
          <div><i class="fa fa-clock-o"></i> {{ page.date|date(config.system.pages.dateformat.short) }}</div>
          {% if page.taxonomy.tag %}
          <div> <i class="fa fa-tags"></i>
            {% for tag in page.taxonomy.tag %}
            <a href="{{ base_url }}/tag:{{ tag }}" rel="tag">{{ tag }}{% if not loop.last %}, {% endif %}</a>
            {% endfor %}
          </div>
          {% endif %}
        </div>
      {% else %}
      <div class="meta1">
        <p>
          <small>
            <span><i class="fa fa-clock-o"></i> {{ page.date|date(config.system.pages.dateformat.short) }}</span>
            {% if page.taxonomy.tag %}
            <span> <i class="fa fa-tags"></i>
              {% for tag in page.taxonomy.tag %}
              <a href="{{ base_url }}/tag:{{ tag }}" rel="tag">{{ tag }}{% if not loop.last %}, {% endif %}</a>
              {% endfor %}
            </span>
            {% endif %}
          </small>
        </p>
      </div>
      {% endif %}

      <div class="clear"></div>

      <div class="{% if truncate %}entry-{% if page.header.youtube or page.header.soundcloud or page.header.vimeo %}video{% else %}image{% endif %}{% else %} resp_video{% endif %}">
        {% if page.header.youtube %}
        <iframe src="{{ page.header.youtube }}?showinfo=0" frameborder="0" allowfullscreen style="width: 750px; height: 421.429px; {% if not truncate %}width: 680px;height: 392px;{% endif %}"></iframe>
        {% endif %}
        {% if page.header.vimeo %}
        <iframe src="{{ page.header.vimeo }}" frameborder="0" allowfullscreen="" data-aspectratio="0.5619047619047619" style="width: 750px; height: 421.429px; {% if not truncate %}width: 680px;height: 392px;{% endif %}"></iframe>
        {% endif %}
        {% if page.header.soundcloud %}
        <iframe width="100%" height="403" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/{{ page.header.soundcloud }}&amp;auto_play=false&amp;hide_related=true&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;visual=true&amp;buying=false"></iframe>
        {% endif %}
        {% if page.media.images|first %}
          {{ page.media.images|first.cropZoom(750,422).html('','', 'img-fluid') |raw }}
        {% endif %}
      </div>

            {% if page.header.continue_link is sameas(false) %}
				{{ page.content }}
            {% if not truncate %}
            {% set show_prev_next = true %}
            {% endif %}
            {% elseif truncate and page.summary != page.content %}
				{{ page.summary |raw}}
            {% elseif truncate %}
				{{ page.content|truncate(550) }}
            {% else %}
				{{ page.content |raw}}
            {% set show_prev_next = true %}
            {% endif %}

            <div class="entry-meta container">
				<div class="row share-story-container">			
				  <div class="col-md-6">
					<ul class="share-story">
					  <li>
						<a href="http://www.facebook.com/share.php?u={{ page.url(true) }}" target="_blank">
						  <i class="fab fa-facebook"></i>
						</a>
					  </li>
					  <li>
						<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url={{ page.url(true) }}&amp;title={{ page.title|replace({' ': "%20"}) }}" target="_blank">
						  <i class="fab fa-linkedin"></i>
						</a>
					  </li>
					</ul>
				  </div>

				  {% if page.header.continue_link is not sameas(false) %}
					{% if truncate and page.summary != page.content %}
					  <div class="col-md-6">
						<a href="{{ page.url }}" class="read-more float-md-right">Skaityti straipsnį</a>
					  </div>
					{% elseif truncate %}
					  <div class="col-md-6">
							<a href="{{ page.url }}" class="read-more float-md-right">Skaityti straipsnį</a>
					  </div>
					{% endif %}
				  {% endif %}
				  <div class="clear"></div>
				</div>
            </div>


            {% if not truncate %}			
			<script src="{{ url('gantry-theme://js/owl.carousel.2.3.4.min.js') }}"></script>
            <div class="related_posts">
              <div id="related-posts">
                <div class="title">
                  <h4>Rekomenduojami straipsniai</h4>
                </div>
                <div class="carousel_related owl-carousel owl-theme" id="related-items-owl">
                  {% include 'partials/relatedpages.html.twig' %}
                </div>
              </div>
              <div style="clear:both"></div>
            </div>
            <script type='text/javascript'>
              $(document).ready(function() {
                $("#related-items-owl").owlCarousel({    
				  loop:true,
				  margin:10,
				  autoplay:true,
				  autoplayTimeout:3000,
				  autoplayHoverPause:true,
                  items : 3,
                  itemsDesktop : [1200,3],
                  itemsDesktopSmall : [980,2],
                  itemsMobile : [480,1]
                });
              });
              </script>
            {% endif %}

      {% if not truncate %}
        {% if config.plugins.jscomments.enabled and config.plugins.jscomments.provider %}
        <div class="comments" id="comments">
          <h4>Comments:</h3>
          <div class="comments-content">
            {{ jscomments(config.plugins.jscomments.provider) }}
          </div>
        </div>
        {% endif %}

        {% if config.plugins.comments.enabled %}
        <div class="comments" id="comments">
          <h4>{{ grav.twig.comments|length }} Comments:</h3>
          <div class="comments-content">
            {% include 'partials/comments.html.twig' with {'page': page} %}
          </div>
        </div>
        {% endif %}

      {% endif %}
    </div>
  </div>
</div>

{% if show_prev_next %}
<div class="blog-pager" id="blog-pager">
  {% if not page.isFirst %}
  <span id="blog-pager-newer-link">
    <a class="blog-pager-newer-link" href="{{ page.nextSibling.url }}"><i class="fa fa-chevron-left"></i> Ankstesnis straipsnis</a>
  </span>
  {% endif %}

  {% if not page.isLast %}
  <span id="blog-pager-older-link">
    <a class="blog-pager-older-link" href="{{ page.prevSibling.url }}">Kitas straipsnis <i class="fa fa-chevron-right"></i></a>
  </span>
  {% endif %}
  <a class="home-link" href="{{ base_url_absolute }}">Pagrindinis</a>
</div>
{% endif %}

@01K, I’m afraid you are scaring off the audience with overwhelming details… :worried:

The chances that someone will really read and try to interpret all code is minimal I guess… I for one didn’t and I like code.

Information that will be more informative:

  • If an exception is thrown it will be logged with much more details and often contain template and line that is offending:
    • What error is in ‘/path/to/grav/logs/grav.log’
      E.g. /path/to/grav/user/themes/quark/templates/partials/base.html.twig:12
    • What error is shown in ‘/var/log/apache2/error.log’ or other webserver?
  • If errors are not indicative enough, what have you tried to pinpoint the exception:
    • Have you tried to comment out includes of templates?
      Start with toplevel template and comment out includes to partial templates and then work ‘down’ the tree of ‘includes’ until you find the one that throws the exception.
  • Which theme are you using?
  • Which version of Grav are your using?

@pamtbaau , thank you for reply.

Grav v1.6.31
Theme - Gantry 5 Helium as a base
The error from grav.log is very long :slight_smile: :

Click here to see long trace.

[2021-01-16 21:51:48] grav.CRITICAL: An exception has been thrown during the rendering of a template (“array_replace_recursive(): Expected parameter 2 to be an array, string given”). - Trace:

  • #0 C:\xampp\htdocs\gerbuvio-darbai_16\vendor\twig\twig\src\Template.php(420): Twig\Template->displayWithErrorHandling(Array, Array)
  • #1 C:\xampp\htdocs\gerbuvio-darbai_16\vendor\twig\twig\src\Environment.php(497) : eval()'d code(156): Twig\Template->display(Array)
  • #2 C:\xampp\htdocs\gerbuvio-darbai_16\vendor\twig\twig\src\Template.php(214): __TwigTemplate_93906cf9500f1aa2abbb92b6587ef152f0809b3ec6c51c79987f51941ded9350___1846255329->block_content(Array, Array)
  • #3 C:\xampp\htdocs\gerbuvio-darbai_16\vendor\twig\twig\src\Environment.php(497) : eval()'d code(55): Twig\Template->displayBlock(‘content’, Array, Array)
  • #4 C:\xampp\htdocs\gerbuvio-darbai_16\vendor\twig\twig\src\Template.php(453): __TwigTemplate_5681f06f23171dee303b5b8127a5eda51387081049aa478df3f277000aa1bae3->doDisplay(Array, Array)
  • #5 C:\xampp\htdocs\gerbuvio-darbai_16\vendor\twig\twig\src\Template.php(420): Twig\Template->displayWithErrorHandling(Array, Array)
  • #6 C:\xampp\htdocs\gerbuvio-darbai_16\vendor\twig\twig\src\Environment.php(497) : eval()'d code(35): Twig\Template->display(Array, Array)
  • #7 C:\xampp\htdocs\gerbuvio-darbai_16\vendor\twig\twig\src\Template.php(453): __TwigTemplate_f484fa1a2049ce070b3de620d66d7641e8e64090d7503d578b67961b12cf2d24->doDisplay(Array, Array)
  • #8 C:\xampp\htdocs\gerbuvio-darbai_16\vendor\twig\twig\src\Template.php(420): Twig\Template->displayWithErrorHandling(Array, Array)
  • #9 C:\xampp\htdocs\gerbuvio-darbai_16\vendor\twig\twig\src\Environment.php(497) : eval()'d code(34): Twig\Template->display(Array, Array)
  • #10 C:\xampp\htdocs\gerbuvio-darbai_16\vendor\twig\twig\src\Template.php(453): __TwigTemplate_634eb816a3bc32179cfbda9f12b4527baec94805835ee2baedc08d1e5be462e6->doDisplay(Array, Array)
  • #11 C:\xampp\htdocs\gerbuvio-darbai_16\vendor\twig\twig\src\Template.php(420): Twig\Template->displayWithErrorHandling(Array, Array)
  • #12 C:\xampp\htdocs\gerbuvio-darbai_16\vendor\twig\twig\src\Environment.php(497) : eval()'d code(120): Twig\Template->display(Array, Array)
  • #13 C:\xampp\htdocs\gerbuvio-darbai_16\vendor\twig\twig\src\Template.php(453): __TwigTemplate_93906cf9500f1aa2abbb92b6587ef152f0809b3ec6c51c79987f51941ded9350___1846255329->doDisplay(Array, Array)
  • #14 C:\xampp\htdocs\gerbuvio-darbai_16\vendor\twig\twig\src\Template.php(420): Twig\Template->displayWithErrorHandling(Array, Array)
  • #15 C:\xampp\htdocs\gerbuvio-darbai_16\vendor\twig\twig\src\Environment.php(497) : eval()'d code(30): Twig\Template->display(Array)
  • #16 C:\xampp\htdocs\gerbuvio-darbai_16\vendor\twig\twig\src\Template.php(453): __TwigTemplate_93906cf9500f1aa2abbb92b6587ef152f0809b3ec6c51c79987f51941ded9350->doDisplay(Array, Array)
  • #17 C:\xampp\htdocs\gerbuvio-darbai_16\vendor\twig\twig\src\Template.php(420): Twig\Template->displayWithErrorHandling(Array, Array)
  • #18 C:\xampp\htdocs\gerbuvio-darbai_16\vendor\twig\twig\src\Template.php(432): Twig\Template->display(Array)
  • #19 C:\xampp\htdocs\gerbuvio-darbai_16\vendor\twig\twig\src\TemplateWrapper.php(47): Twig\Template->render(Array, Array)
  • #20 C:\xampp\htdocs\gerbuvio-darbai_16\vendor\twig\twig\src\Environment.php(384): Twig\TemplateWrapper->render(Array)
  • #21 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Common\Twig\Twig.php(388): Twig\Environment->render(‘blog.html.twig’, Array)
  • #22 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Common\Service\OutputServiceProvider.php(28): Grav\Common\Twig\Twig->processSite(‘html’)
  • #23 C:\xampp\htdocs\gerbuvio-darbai_16\vendor\pimple\pimple\src\Pimple\Container.php(118): Grav\Common\Service\OutputServiceProvider->Grav\Common\Service{closure}(Object(Grav\Common\Grav))
  • #24 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Common\Processors\RenderProcessor.php(28): Pimple\Container->offsetGet(‘output’)
  • #25 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(45): Grav\Common\Processors\RenderProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler))
  • #26 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(57): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #27 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Common\Processors\DebuggerAssetsProcessor.php(28): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #28 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(45): Grav\Common\Processors\DebuggerAssetsProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler))
  • #29 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(57): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #30 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Common\Processors\PagesProcessor.php(69): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #31 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(45): Grav\Common\Processors\PagesProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler))
  • #32 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(57): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #33 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Common\Processors\TwigProcessor.php(27): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #34 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(45): Grav\Common\Processors\TwigProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler))
  • #35 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(57): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #36 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Common\Processors\AssetsProcessor.php(28): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #37 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(45): Grav\Common\Processors\AssetsProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler))
  • #38 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(57): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #39 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Common\Processors\SchedulerProcessor.php(29): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #40 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(45): Grav\Common\Processors\SchedulerProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler))
  • #41 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(57): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #42 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Common\Processors\BackupsProcessor.php(28): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #43 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(45): Grav\Common\Processors\BackupsProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler))
  • #44 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(57): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #45 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Common\Processors\TasksProcessor.php(59): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #46 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(45): Grav\Common\Processors\TasksProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler))
  • #47 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(57): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #48 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Common\Processors\RequestProcessor.php(52): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #49 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(45): Grav\Common\Processors\RequestProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler))
  • #50 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(57): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #51 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Common\Processors\ThemesProcessor.php(27): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #52 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(45): Grav\Common\Processors\ThemesProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler))
  • #53 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(57): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #54 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Common\Processors\PluginsProcessor.php(30): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #55 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(45): Grav\Common\Processors\PluginsProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler))
  • #56 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(57): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #57 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Common\Processors\InitializeProcessor.php(95): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #58 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(45): Grav\Common\Processors\InitializeProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler))
  • #59 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(57): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #60 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Common\Processors\DebuggerProcessor.php(27): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #61 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(45): Grav\Common\Processors\DebuggerProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler))
  • #62 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(57): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #63 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Common\Processors\ErrorsProcessor.php(27): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #64 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(45): Grav\Common\Processors\ErrorsProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler))
  • #65 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(57): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #66 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Common\Processors\LoggerProcessor.php(48): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #67 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(45): Grav\Common\Processors\LoggerProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler))
  • #68 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(57): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #69 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Common\Processors\ConfigurationProcessor.php(49): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #70 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(45): Grav\Common\Processors\ConfigurationProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler))
  • #71 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(57): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #72 C:\xampp\htdocs\gerbuvio-darbai_16\system\src\Grav\Common\Grav.php(272): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest))
  • #73 C:\xampp\htdocs\gerbuvio-darbai_16\index.php(54): Grav\Common\Grav->process()
  • #74 {main} [] []

Apache doesn’t throw any errors.

At this moment pagination is set to show 3 pages, buttons “1”, “2” and “3”. Once I click the “3” - error is not produced… If I click “2” - the error is thrown.

Here is a screenshot from debugger.

I’ve taken all examples from skeletons or official grav’s examples. That’s strange. It seems that the problem is somewhere in twig’s URL formation… base_url or something else… But it is only assumption

@01K,

grav.log:
The only template file references in the stacktrace is blog.html.twig without a code line. That’s a bit of non-information…

Image:
However, the image gives a clear cue at the top: blog_item.html.twig line 62

pointing at the following code:
image

So there is something wrong with a single blog item…

Further down, you you’ll find:
image

The offending page appears to have a YouTube video, because a youtube plugin breaks on mergeConfig.
Plugin::mergeConfig is used to merge the config files of the plugin (e.g. ‘user/config/plugins/youtube.yaml’) with the header of the page.

My guess is that the config file of the plugin and/or the page header are incorrect.

Please check if the config file and the page header conform with the config file(s) and page header as shown in the README of the plugin.

@pamtbaau, thank you very much!
You are right!
The problem was that in header: I had youtube custom var and I had a youtube plug-in installed. So this caused a conflict, because parameters were different.

As an additional question, could you suggest a simple solution to change a pagination URL from page:2 into page2 ?

@01K, Please open a new topic for your question on the URL, to prevent it getting buried and lost in this thread.

1 Like