If I go to my recent posts tacker/1 I get this error I think it belongs here.

* warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /home1/cyvocnet/public_html/drupal/sites/all/modules/views/includes/view.inc on line 1286.
* warning: mysqli_real_escape_string() expects parameter 2 to be string, object given in /home1/cyvocnet/public_html/drupal/includes/database.mysqli.inc on line 323.
* warning: Illegal offset type in /home1/cyvocnet/public_html/drupal/sites/all/modules/views/includes/view.inc on line 1290.
* warning: Illegal offset type in /home1/cyvocnet/public_html/drupal/sites/all/modules/views/includes/view.inc on line 1325.
* warning: Illegal offset type in isset or empty in /home1/cyvocnet/public_html/drupal/sites/all/modules/views/views.module on line 698.

I have searched here and google with no luck I hope someone has an idea
Thanks for your time
TOm

Comments

merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)

Are you using an older version of Views and/or an older version of the taxonomy_menu module?

don@robertson.net.nz’s picture

I have just upgraded to Drupal 6.15, Views 6.x-2.8, and do not have Taxonomy Menu. All modules are up to date.

I am getting the same error.

In Views / Tracker / page, adding a UID in the preview Arguments field generates at list of items correctly (I think - just testing at the moment and all the posts are from me ;-)

don

BTW - clicking Preview on this page removed the content of the post.

tsavory’s picture

I am using views 2.8 I have not put the 3.0alpha
and
taxonomy_menu module 2.3 not the 2.4-rc1

dagmar’s picture

Status: Postponed (maintainer needs more info) » Active
tsavory’s picture

I don't know whats up i have not done anything but it is working fine now.

benyhirmansyah’s picture

Hi, I also getting some error. How to fix this? Is it a module issues?

marty.true’s picture

Same problem and it seems to appear in the log every time cron is run:

array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /home/xxxxxx/public_html/sites/all/modules/views/includes/view.inc on line 1286.

Any news on this?

jryanz’s picture

Priority: Minor » Normal

Having same problem

* warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /sites/all/modules/views/includes/view.inc on line 1286.
* warning: mysql_real_escape_string() expects parameter 1 to be string, object given in /includes/database.mysql.inc on line 321.
* warning: Illegal offset type in /sites/all/modules/views/includes/view.inc on line 1290.
* warning: Illegal offset type in /sites/all/modules/views/includes/view.inc on line 1325.
* warning: Illegal offset type in isset or empty in /sites/all/modules/views/views.module on line 698.

jryanz’s picture

Not sure how the paths work with this mod, but visiting /user/1/tracker works. "My recent posts" tries to go to /tracker/1, which shows a Page Not Found with the errors above.

mjohnq3’s picture

I get the same errors but only if the optional core Tracker module is enabled. However, when the core module is disabled there is no link for 'My recent posts' on the resulting tracker page. Entering the URL .../tracker/1 produces the correct output.

I have a Drupal 6.15 clean installation using Views 6.x-2.8 with Apache 2.2.11, PHP 2.2.11, and MySQL 5.1.34.

dawehner’s picture

I get the same errors but only if the optional core Tracker module is enabled. 

Sure you shouldn't enabled tracker module, if you enabled the tracker view, thats not a good idea. I suggest to change the view, to add the my recent posts link. Thats doable with views.

rfay’s picture

I have this as well, and I believe it does go away with tracker module disabled.

However, tracker is useful.

@dereine, could you please elaborate on your proposed fix #11? How to track a user's recent posts?

This problem is not hard to demonstrate (I don't think) and should probably be fixed.

Thanks!

dawehner’s picture

Status: Active » Fixed

If you have enabled the tracker module, However, tracker is useful.you have to change the path of the tracker view. Thats it.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Guillaume Schieber’s picture

You have to deactivate the Tracker module, then deactivate the view : "tracker (default)" (that was left from the last version update, from your configuration), then activate the Tracker module.
Should work.

glewe’s picture

To automatically close an issue after 2 weeks of inactivity is understandable but to call it "fixed" is a little bold, don't you think ?

Anyways, I am experiencing the same issue:

When I have the Tracker module enabled I am getting the same error with page not found. When I disable the Tracker module and submit the URL manually (/tracker/1234) it works ok.

What I was able to debug so far is that the argument $arg in function &load($arg, $reset = FALSE) in line 1292 of view.inc contains a stdClass object when the Tracker module is enabled. When I disable the module, $arg contains the string "tracker_comments" which obviously is the name of the view to show.

I tried the steps suggested above (disabling the module, then the default view, then enabling the module again) to no success. Whatever I do, as soon as the Tracker module is enabled I am getting the same warning messages and page not found.

I would appreciate some help.

Thanks and regards,
Sundance

rfay’s picture

Status: Closed (fixed) » Active

I would prefer to see a comprehensive solution to this, at least in this issue. I haven't solved it completely on my server without losing features.

@dereine, if I disable tracker, I lose features that I want and that my site administrators need.

merlinofchaos’s picture

If tracker.module is enabled, do not enable the tracker view.

If tracker view is enabled, do not enable tracker module.

The issue is that Views' attempts to take over the menu item is too naive to work there. So the answer is "Don't do that." I'm not sure that this is something that *can* be fixed, in the sense of getting the two to work together nicely.

mrgavindb’s picture

I have this problem also. I had the tracker view enabled because there was certain posts that I did not want to show up on Recent posts. I also wanted users to be able to track their own posts, so I had Tracker Module enabled. Here's what I did to fix(kinda) the problem: I removed the link to recent posts on the navigation menu. I changed the path on the tracker view to /recentposts. I added an item to the navigation menu titled Recent Posts that links to /recentposts. Now posts that I do not want showing up in Recent Posts do not show up and users can track their own posts from their profile page.

glewe’s picture

Enabling Tracker module and not Tracker view or the other way around does not work.

Also, when disabling the Tracker module/view the post lists do not show the 'new' and 'updated' indicators anymore. That is a feature I really need.

A solution for this problem would really be appreciated.

Best regards,
Sundance

glewe’s picture

This helps supressing the error messages. It does NOT solve the problem:

File: sites/all/modules/view/include/view.inc
Line: 1292ff

  function &load($arg, $reset = FALSE) {
    static $cache = array();

    // MOD START =============================================================
    //
    // Addressing the Tracker module issue in Drupal 6 where 'My Recent Posts'
    // causes an error. See here: http://drupal.org/node/668614
    // The error obviously is that $arg is an array instead of an integer or a
    // string when this bug occurs. I am trying to catch that here.
    //
    // This mod just works around the error message. It does not fix the root
    // cause.
    //
    if (!is_numeric($arg) AND !is_string($arg)) {
      $arg = $GLOBALS['user']->name;
    }
    // MOD END ===============================================================

    // We want a NULL value to return TRUE here, so we can't use isset() or empty().
    if (!array_key_exists($arg, $cache) || $reset) {
...

File: sites/all/modules/view/view.module
Line: 723ff

function &views_get_default_view($view_name) {
  $null = NULL;

  // MOD START =============================================================
  // Author: George Lewe
  // Date:   19.May.2010
  //
  // Addressing the Tracker module issue in Drupal 6 where 'My Recent Posts'
  // causes an error. See here: http://drupal.org/node/668614
  // The error obviously is that $view_name is an array instead of a
  // string when this bug occurs. Return NULL when that happens.
  //
  // This mod just works around the error message. It does not fix the root
  // cause.
  //
  if (!is_string($view_name)) {
    return $null;
  }
  // MOD END ===============================================================
  
  // Attempt to load individually cached view from cache.
  views_include('cache');
...

Best regards,
Sundance

solodky’s picture

Thanks that worked for me...

Letharion’s picture

Status: Active » Closed (won't fix)

Summary:
The cause of the problem is using both the core module "tracker" and the view tracker.
They use the path, and thus collide.
The general recommendation is: Don't use both at the same time.
Another solution is to change the views path.
Until someone has a suggestion for making them work together nicely, this is a won't fix.