Skip to content

Commit

Permalink
Fix compatibility warnings for PHP7
Browse files Browse the repository at this point in the history
Picked from 2d0869f
Re #75
Fixes #79
  • Loading branch information
Alexandra Nantel authored and nitriques committed Oct 24, 2017
1 parent 34aa408 commit 02ee03b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions fields/field.multilingual_textbox.php
Expand Up @@ -107,7 +107,7 @@ public function createHandle($value, $entry_id, $lc = null)
return $handle;
}

public function getCurrentHandle($entry_id, $lc)
public function getCurrentHandle($entry_id, $lc = null)
{
return Symphony::Database()->fetchVar('handle', 0, sprintf(
"
Expand All @@ -125,7 +125,7 @@ public function getCurrentHandle($entry_id, $lc)
));
}

public function isHandleLocked($handle, $entry_id, $lc)
public function isHandleLocked($handle, $entry_id, $lc = null)
{
return (boolean) Symphony::Database()->fetchVar('id', 0, sprintf(
"
Expand All @@ -143,7 +143,7 @@ public function isHandleLocked($handle, $entry_id, $lc)
));
}

public function isHandleFresh($handle, $value, $entry_id, $lc)
public function isHandleFresh($handle, $value, $entry_id, $lc = null)
{
return (boolean) Symphony::Database()->fetchVar('id', 0, sprintf(
"
Expand Down Expand Up @@ -350,7 +350,7 @@ public function commit()
/* Publish */
/*------------------------------------------------------------------------------------------------*/

public function displayPublishPanel(&$wrapper, $data = null, $error = null, $prefix = null, $postfix = null)
public function displayPublishPanel(XMLElement &$wrapper, $data = null, $flagWithError = null, $fieldnamePrefix = null, $fieldnamePostfix = null, $entry_id = null)
{
// We've been called out of context: Publish Filter
$callback = Administration::instance()->getPageCallback();
Expand Down Expand Up @@ -459,7 +459,7 @@ public function displayPublishPanel(&$wrapper, $data = null, $error = null, $pre
// Input box:
if ($this->get('text_size') === 'single') {
$input = Widget::Input(
"fields{$prefix}[$element_name]{$postfix}[{$lc}]", General::sanitize($data["value-$lc"])
"fields{$fieldnamePrefix}[$element_name]{$fieldnamePostfix}[{$lc}]", General::sanitize($data["value-$lc"])
);

###
Expand All @@ -471,7 +471,7 @@ public function displayPublishPanel(&$wrapper, $data = null, $error = null, $pre
// Text Box:
else {
$input = Widget::Textarea(
"fields{$prefix}[$element_name]{$postfix}[{$lc}]", 20, 50, General::sanitize($data["value-$lc"])
"fields{$fieldnamePrefix}[$element_name]{$fieldnamePostfix}[{$lc}]", 20, 50, General::sanitize($data["value-$lc"])
);

###
Expand Down Expand Up @@ -653,7 +653,7 @@ public function fetchIncludableElements()
return $includable_elements;
}

public function appendFormattedElement(XMLElement &$wrapper, $data, $encode = false, $mode = null)
public function appendFormattedElement(XMLElement &$wrapper, $data, $encode = false, $mode = null, $entry_id = null)
{
// all-languages
$all_languages = strpos($mode, 'all-languages');
Expand Down Expand Up @@ -725,7 +725,7 @@ public function appendFormattedElement(XMLElement &$wrapper, $data, $encode = fa
}

// @todo: remove and fallback to default (Symphony 2.5 only?)
public function prepareTableValue($data, XMLElement $link = null)
public function prepareTableValue($data, XMLElement $link = null, $entry_id = NULL)
{
$lc = $this->getLang($data);

Expand Down Expand Up @@ -764,7 +764,7 @@ protected function getLang($data = null)
return $lc;
}

public function getParameterPoolValue($data)
public function getParameterPoolValue(array $data, $entry_id = NULL)
{
$lc = $this->getLang();
return $data["value-$lc"];
Expand Down Expand Up @@ -868,7 +868,7 @@ public function buildDSRetrievalSQL($data, &$joins, &$where, $andOperation = fal
Sorting:
-------------------------------------------------------------------------*/

public function buildSortingSQL(&$joins, &$where, &$sort, $order = 'ASC')
public function buildSortingSQL(&$joins, &$where, &$sort, $order = 'ASC', &$select = NULL)
{
$lc = FLang::getLangCode();

Expand Down

0 comments on commit 02ee03b

Please sign in to comment.