I have this warning message when overriding default order of formats for field comment

Strict warning: Only variables should be passed by reference w better_formats_filter_process_format() (line 132 in ...\sites\all\modules\better_formats\better_formats.module).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

milley’s picture

Title: Strict warning when override order of formats in comments » Strict warning when override order of formats

When I add new content with reordered formats for some field I also have this warning.

mathieso’s picture

This patch should fix it.

Note: I'm still learning about patch files. Please let me know if aught is wrong. The changes are at line 132, replacing ...

$element['format']['format']['#default_value'] = array_shift(array_keys($options));

... with ...

$options_keys = array_keys($options);
$element['format']['format']['#default_value'] = array_shift($options_keys);

Kieran

meridiandigital’s picture

Status: Active » Reviewed & tested by the community

Confirm patch works as advertised.

drupov’s picture

Patch works for me too.

dragonwize’s picture

Status: Reviewed & tested by the community » Fixed

Thanks. Committed.

Status: Fixed » Closed (fixed)

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

wylbur’s picture

Status: Closed (fixed) » Needs work

This is still an issue when using PHP 5.4. Drupal reports this error when you change the default sort order of formats.

The patch listed in comment #2 does not work as it is a zero length file.

I applied the changes to the file, and that resolved the error for me. This is ready for rolling a real patch and testing.

dww’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev
Status: Needs work » Closed (fixed)

It's been fixed in 7.x-1.x-dev. beta1 still has the broken code. You need to upgrade to the latest dev (or wait for beta2 to come out).

Weird that that patch file is empty. Here's the commit that's in Git that fixes the bug:

http://drupalcode.org/project/better_formats.git/commitdiff/ca0822a

Good luck,
-Derek

Anybody’s picture

Issue summary: View changes

This fix is now very old but the problem still exists in the latest version. Is it possible to release a new beta version soon to have this fixed? It should not get worse by that but you would make many people happy :)

edachan’s picture

mbruneel’s picture

drupov’s picture

As stated in #8 if you use latest dev, the error should not appear.

AexChecker’s picture

Status: Closed (fixed) » Needs review
FileSize
493 bytes
Chipie’s picture

#13 works for me

loopduplicate’s picture

loopduplicate’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

Anybody’s picture

Please create a new stable release. This is still unfixed in the latest stable, which is very sad. The .dev is well tested and OK!

Any active maintainer here?

tregismoreira’s picture

#13 works for me. Thanks! :)

steveoriol’s picture

#13 works for me too. Thanks! :-)