Closed (won't fix)
Project:
Views (for Drupal 7)
Version:
6.x-3.x-dev
Component:
page displays
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Sep 2008 at 07:37 UTC
Updated:
27 Oct 2011 at 20:49 UTC
function mytheme_views_view_field__listusers__page__edit_node($par1,$par2,$par3) {
return l(t('edit'),'admin/estock/user/'.$par3->uid.'/edit');
}
Here is a function I am using for changing user edit link in view.
On the first page it is used and link appears as it should. But after using any ajax operation (page change or filter) link becomes default ( user/NUMBER/edit) and my template function is no more used.
Comments
Comment #1
copyhold commentedIn addition
It was also found, that not just field template is not in use after ajax operation. But template file from views folder ( views-view.tpl.php ) is used instead of file from theme folder.
Comment #2
merlinofchaos commentedI haven't seen this happen; do you have some custom code that changes the default theme selection? Perhaps the AJAX calls end up with the wrong theme and so the template files are not visible at that time?
Comment #3
copyhold commentedNo I don't. I just copied views-view.tpl.php file to my theme and made some cosmetic changes in it. Fistt time page shown new template os on use, after clicking on pager the old one (default views-view ) file is used.
Comment #4
merlinofchaos commentedI can't duplicate this on my test setup; using ajax, the theme overrides are working for me.
I recommend you do some theme investigation in your template. do 'global $theme' and display the contents of this variable. See if that changes during AJAX.
Comment #5
merlinofchaos commentedWon't fixing since cannot replicate.
Comment #6
jasondecamp commentedmerlinofchaos,
I am experiencing this problem as well, but it is likely due to the fact that my site has different themes for different sections (using the sections module). Is there a way to make the ajax updates pass the fields through the template files for the active theme instead of the site default theme? If not, I can probably just copy the views templates into the default theme, but then I have to maintain two identical copies of each views template file so that the initial page load is themed correctly, as well as the subsequent ajax reloads.
Thanks!
Comment #7
dawehner@jasondecamp
How do you switch between the different themes?
For themekey there was an issue some time ago #567222: ajax views do not work with the themekey module
Comment #8
merlinofchaos commentedThe AJAX callback has no notion of the 'active' theme on the page that called it. In Drupal 6, that information is not communicated. It simply has no way of knowing.
You can force the issue in hook_init() if you can find some way to tell, but Views cannot do this for you.
Comment #9
jasondecamp commentedThanks for the answer merlin, i'll try to find another way.