Download & Extend

Strict warning : Only variables should be passed by reference dans views_page_title_pattern_alter()

Project:Page Title
Version:7.x-2.5
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Hello
I tried to use page_title in views (without any success for now) so I made a display in a view with the page_title option. Because I failed to make it work, I've deleted this display, and left my view has it was before my test.

Since then, when I go on pages made by views, I got this srtict warning :

Strict warning : Only variables should be passed by reference dans views_page_title_pattern_alter()(line 33 in /sites/all/modules/page_title/modules/views.page_title.inc).

Anyone has an idea from where it can come from ?
Maybe must I delete something in the DB ?

Thanks for your help.

Comments

#1

I wonder what's being passed into that function which isn't a variable?!

#2

Is that suppose to mean that I can't pass some fixed string, must only use the tokens ?
...

#3

You cant alter a fixed string - however you can alter a string assigned to a variable... eg:

Bad:

<?php
thingy
('test');

function
thingy(&$var) {
 
$var = 'another test';
}
?>

Good

<?php
$a
= 'test';
thingy($a);

function
thingy(&$var) {
 
$var = 'another test';
}
?>

#4

To fix the original problem in views.page_title.inc, replace line 33 with this:

// $h = array_shift(array_splice($h, count($args)-1, 1));
$hh = array_splice($h, count($args)-1, 1);
$h = array_shift($hh);

#5

subscribe

#6

I get the following error-message:

Strict warning: Only variables should be passed by reference in views_page_title_pattern_alter() (line 33 of C:\xampplite\htdocs\abt\sites\all\modules\page_title\modules\views.page_title.inc).

Please help me.
Thanks in advance

#7

I get the exact same error-message (#6), did you solve it?

#8

Marshall_Kennard , thanks

#9

That is the same message as the original post and the solution is in post #4...

#10

Status:active» needs review

Attached patch from comment #4

AttachmentSize
page_title-array_shift-1206164-4.patch 0 bytes

#11

Sorry empty patch; this should be right.

AttachmentSize
page_title-array_shift-1206164-4.patch 682 bytes

#12

Status:needs review» reviewed & tested by the community

Looks good and works as advertised.

#13

works! thanks for sharing :)

#14

An update of the module which includes this patch would be great :)

#15

Status:reviewed & tested by the community» fixed

This is fixed and committed into Dev branches for D6 and D7. Tagged release soon!

#16

Status:fixed» closed (fixed)

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