Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
14 Sep 2011 at 05:59 UTC
Updated:
4 Jan 2014 at 01:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dave reidPhase one of my plan to convert Views to use Token API is now written. :) (just kidding)
Comment #2
dawehnerI'm wondering whether $view->get_url() should be used as get_url() uses arguments and some other stuff.
Comment #3
dave reidWell the idea behind this is you're passing in a view that's being currently executed (I'm using token replacement in during view preview and also execute). Should just be a known issue that if you're not passing in a view with arguments and things that those tokens may not work properly.
Comment #4
dawehnerIf you directly executed the code given above you will see the difference between get_path and get_url() and i think the user actually want get_url() because this one has the arguments. Perhaps i don't get your last comment, it's 1:30 am.
Comment #5
dave reidHrm, I used $view->get_url() as that's what includes/admin.inc uses as the 'Path' information in previewing a view.
Comment #6
dave reidBLARGH I wrote the patch using get_path() and not get_url(). davereid--
Comment #7
dave reidComment #8
dawehnerStill using get_path, i'm confused. Perhaps it would help if you could explain why you use get_path() :)
Views uses get_path in the admin listing ui, because there are no arguments availible.
Comment #9
dave reidBecause I'm stupid and can't roll a patch correctly. :)
Comment #10
dave reidLet's try this again.
Comment #11
dawehnerI just wanted to commit it but i stumbled upon the filename.
In views it should be probably in the includes dir, is this possible with the hook system in drupal7?
Comment #12
dave reidShort answer, no. :)
Comment #13
matglas86 commentedIn your patch you say that this only works when Token module is installed. Then this should check
module_exists('token');
So to change the code, it would become:
Comment #14
dave reidNo we don't because it gracefully fails if Token is not enabled. Using module_exists() is unnecessary.
Comment #15
matglas86 commentedOk :). Sorry for mistaking. I didnt test it.
Comment #16
dawehnerSo as there is no way around it, committed to 7.x-3.x