To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Ticket #528 (closed defect: fixed)

Opened 18 months ago

Last modified 13 months ago

Missing getRaw('sf_user') in modules/a/templates/_variant.php

Reported by: asaphosting Owned by: agilbert
Priority: major Milestone:
Component: apostrophePlugin Version: trunk
Keywords: Cc: info@…
Symfony version: 1.4

Description

Hey there Tom,

I found a bug – there's a missing getRaw('sf_user') in the _variant.php partial.

PHP throws a warning: "Warning: array_flip() expects parameter 1 to be array, object given in /opt/local/apache2/htdocs/dynamedia/plugins/apostrophePlugin/lib/toolkit/BaseaTools.class.php on line 600". That's because when Apostrophe tries to build the slot variant menu it want to do an array_flip() but it's not operating on an array, it's given an object of the type sfOutputEscaperArrayDecorator.

Attached patch is open to discussion. I just added the sf_user variable to the variables to unescape up top. I also experimented with adding ESC_RAW to the $sf_user->getAttribute(..., ESC_RAW) method call (as is documented) in line 10 but it didn't work.

I don't know if the sf_user variable should really be unescaped here or if we should deal with the sfOutputEscaperArrayDecorator in the aTools::getVariantsForSlotType method instead.

Cheers, Daniel

Attachments

_variant.php.diff Download (0.6 KB) - added by anonymous 18 months ago.

Change History

Changed 18 months ago by anonymous

Changed 18 months ago by asaphosting

  • cc info@… added

Changed 18 months ago by asaphosting

  • version set to trunk

Changed 13 months ago by johnnyoffline

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.