<small id='Xuxly'></small><noframes id='Xuxly'>

      • <bdo id='Xuxly'></bdo><ul id='Xuxly'></ul>
    1. <i id='Xuxly'><tr id='Xuxly'><dt id='Xuxly'><q id='Xuxly'><span id='Xuxly'><b id='Xuxly'><form id='Xuxly'><ins id='Xuxly'></ins><ul id='Xuxly'></ul><sub id='Xuxly'></sub></form><legend id='Xuxly'></legend><bdo id='Xuxly'><pre id='Xuxly'><center id='Xuxly'></center></pre></bdo></b><th id='Xuxly'></th></span></q></dt></tr></i><div id='Xuxly'><tfoot id='Xuxly'></tfoot><dl id='Xuxly'><fieldset id='Xuxly'></fieldset></dl></div>

    2. <tfoot id='Xuxly'></tfoot>
      <legend id='Xuxly'><style id='Xuxly'><dir id='Xuxly'><q id='Xuxly'></q></dir></style></legend>

      1. Drupal hook_views_post_execute 没有被调用

        时间:2023-06-22
          <bdo id='7Z6aD'></bdo><ul id='7Z6aD'></ul>
          • <legend id='7Z6aD'><style id='7Z6aD'><dir id='7Z6aD'><q id='7Z6aD'></q></dir></style></legend>
              <tfoot id='7Z6aD'></tfoot>

                <tbody id='7Z6aD'></tbody>
            1. <small id='7Z6aD'></small><noframes id='7Z6aD'>

                • <i id='7Z6aD'><tr id='7Z6aD'><dt id='7Z6aD'><q id='7Z6aD'><span id='7Z6aD'><b id='7Z6aD'><form id='7Z6aD'><ins id='7Z6aD'></ins><ul id='7Z6aD'></ul><sub id='7Z6aD'></sub></form><legend id='7Z6aD'></legend><bdo id='7Z6aD'><pre id='7Z6aD'><center id='7Z6aD'></center></pre></bdo></b><th id='7Z6aD'></th></span></q></dt></tr></i><div id='7Z6aD'><tfoot id='7Z6aD'></tfoot><dl id='7Z6aD'><fieldset id='7Z6aD'></fieldset></dl></div>
                  本文介绍了Drupal hook_views_post_execute 没有被调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试连接 Drupal 7 中的 hook_views_post_execute 事件,我的名为 foo 的模块位于 sites/default/modules/features/foo.

                  I'm trying to hook into the hook_views_post_execute event in Drupal 7, my module called foo is located in sites/default/modules/features/foo.

                  我的 foo.module 文件包含对 hook_views_api 函数的定义,定义如下:

                  My foo.module file contains a definition for the hook_views_api function, defined like this:

                  function foo_views_api() {
                      return array("version" => 3.0);
                  }
                  

                  这个函数被调用了,但我的 hook_views_post_execute 实现没有,它是这样定义的(在同一个 foo.module 文件中):

                  This function gets called, but my implementation of the hook_views_post_execute does not, it's defined (in the same foo.module file) like this:

                  function foo_views_post_execute(&$view) {
                  
                      $seen_rows = array();
                      $newResults = array();
                  
                      for($i = 0; $i < count($view->result); ++$i) {
                          if (!in_array($view->result[$i]->nid, $seen_rows)) {
                              $newResults[] = $view->results[$i];
                          }
                  
                          $seen_rows[] = $view->result[$i]->nid;
                      }
                  
                      $view->result = $newResults;
                  
                  }
                  

                  我已经浏览了 drupal API/hooks 文档,在谷歌上搜索并阅读了我能找到的每篇博文.我只是无法让它工作.钩子不会被调用.我假设我做了一些简单的错误,因为我通常不是 Drupal 开发人员或 PHP 开发人员.

                  I've been over the drupal API/hooks documentation, googled and read every blog post I've been able to find. I just can't get it to work. The hook does not get called. I'm assuming I've done something simple wrong since I'm not a drupal developer or PHP developer normally.

                  推荐答案

                  该视图可能已被缓存,因此它不会通过该函数.

                  The view has probably been cached so it doesn't go through that function.

                  转到左上角并清除缓存,您应该会看到结果.

                  Go to the top left and clear the cache and you should see the result.

                  这篇关于Drupal hook_views_post_execute 没有被调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:drupal 视图对这个用例有用吗 下一篇:主题化 Drupal 7 的 Ubercart “/cart"页

                  相关文章

                  <small id='PwUV4'></small><noframes id='PwUV4'>

                • <i id='PwUV4'><tr id='PwUV4'><dt id='PwUV4'><q id='PwUV4'><span id='PwUV4'><b id='PwUV4'><form id='PwUV4'><ins id='PwUV4'></ins><ul id='PwUV4'></ul><sub id='PwUV4'></sub></form><legend id='PwUV4'></legend><bdo id='PwUV4'><pre id='PwUV4'><center id='PwUV4'></center></pre></bdo></b><th id='PwUV4'></th></span></q></dt></tr></i><div id='PwUV4'><tfoot id='PwUV4'></tfoot><dl id='PwUV4'><fieldset id='PwUV4'></fieldset></dl></div>

                  <tfoot id='PwUV4'></tfoot><legend id='PwUV4'><style id='PwUV4'><dir id='PwUV4'><q id='PwUV4'></q></dir></style></legend>

                        <bdo id='PwUV4'></bdo><ul id='PwUV4'></ul>