Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/Command/ExtractCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class ExtractCommand extends BaseCommand

protected $_useResource = null;
protected $_resource = false;
protected $_defaultTVValues = array();

protected function configure()
{
Expand Down Expand Up @@ -370,10 +371,16 @@ protected function objectToArray(\xPDOObject $object)
$templateVars = $object->getTemplateVars();
foreach ($templateVars as $tv) {
/** @var \modTemplateVar $tv */
if(!isset($this->_defaultTVValues[$tv->get('id')])) {
// get default TV value
$tvObject = $this->modx->getObject('modTemplateVar', $tv->get('id'));
$this->_defaultTVValues[$tv->get('id')] = $tvObject->get('default_text');
}
if ($tv->get('value') === $this->_defaultTVValues[$tv->get('id')]) continue;
$tvs[$tv->get('name')] = $tv->get('value');
}
ksort($tvs);
$data['tvs'] = $tvs;
if(!empty($tvs)) $data['tvs'] = $tvs;;
break;

// Handle string-based categories automagically on elements
Expand Down