I thought I'd try and understand arguments by enabling one of the default views from Views2 and try to see how it works/what it does. I enabled the 'recent posts' view. It has an argument for user UID.

If I go to: http://domain.net/tracker the view works and displays a 'recent posts list' for all users
So how do I get the argument to work?
With 'admin' being my only user at the moment, I've tried:

http://domain.net/tracker/admin
http://domain.net/tracker/1
http://domain.net/tracker/user/1
http://domain.net/1/tracker
http://domain.net/user/1/tracker
etc.

Most give a 'page not found' error.
http://domain.net/tracker/1 gives an SQL query error:

* warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /home/USER/public_html/web/sites/all/modules/views/includes/view.inc on line 1153.
* warning: mysqli_real_escape_string() expects parameter 2 to be string, object given in /home/USER/public_html/web/includes/database.mysqli.inc on line 323.
* warning: Illegal offset type in /home/USER/public_html/web/sites/all/modules/views/includes/view.inc on line 1157.
* warning: Illegal offset type in /home/USER/public_html/web/sites/all/modules/views/includes/view.inc on line 1192.
* warning: Illegal offset type in isset or empty in /home/USER/public_html/web/sites/all/modules/views/views.module on line 684.

So what is wrong?
How am I supposed to get to the 'recent posts by %1' page?
Also, any links to *good, clear* documentation and examples of arguments would be appreciated.

Cheers.

Comments

WorldFallz’s picture

I'm not sure what this error is, I'm getting it also. From what I can see in the view, tracker/1 should work-- and it does work in the preview.

In any case, a couple of links I found useful for groking arguments:

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

-Anti-’s picture

> I'm not sure what this error is, I'm getting it also

Ah, thanks for checking. That's good to know.

Cheers for the links... yeah, I've seen all those. Basically I've done enough reading (which isn't great because everything pertains to D5) and so I need to start testing stuff out for myself. But everything I try either doesn't work or causes errors, so it's hard to learn about!

Maybe I'll just forget arguments for a few months until a few more of the bugs have been fixed. It looks kind-of important to know about though.

eggthing’s picture

I'm getting the same mysql error on both the original tracker and tracker2 at http://domain.net/tracker/1 after upgrading to Drupal 6.10. I'm using a modifed tracker view. I wonder if there is some way to remove the "My recent posts" from the tracker page view. Disabling the menu in the view does nothing. There seems to be an unusual integration between views and tracker.

grasmash’s picture

I'm having the same issue when viewing "my recent posts" through the tracker. Has anyone found a way to disable this tab or solve the problem?

grasmash’s picture

I went through the source code and could not figure out where the "My recent posts" tab was created.

However, I came up with a simple workaround that removes the tab from the user's view.

-create a block that is shown only on the "tracker" page. I located mine in the content area so as not to displace any other elements.
-leave the title blank
-in the body of the block, paste:

<script language="javascript">
$(document).ready(function(){
    $("ul.tabs li:eq(1)").css({"display" : "none"});
});
</script>

if you'd rather just remove the that tabs bar altogether, paste this instead:

<script language="javascript">
$(document).ready(function(){
    $("div.content-bar").css({"display" : "none"});
});
</script>

This uses jQuery to remove the "My recent posts" tab through the DOM after the page loads. Badabing Bababoom.

vfwh’s picture

I had the same problem, and tried several configurations, without solving the problem. What I can see is this:

- the tabs for 'all content' and 'own contributions' are tabs that are put there by the regular tracker module
- if you disable the regular 'tracker'module and enable the Views Tracker module, then you get your nice configurable tracker page, but without those two tabs.
- any configuration, with any filters and arguments that I have tried, that combine an active regular tracker module with an active Tracker View will break the 'own contributions' tab as described above.

So it's an either/or situation: you either have the standard Drupal tracker module with the tabs but simple list, or you have the Views Tracker, with the sophisticated views, but without those tabs.

It kind of defeats the purpose to forfeit functionality for the benefit of Views...