Created
December 17, 2013 13:45
-
-
Save Ben-Ho/8005113 to your computer and use it in GitHub Desktop.
This code snippet should be used when updating koala-framework from version 3.5 to anything above because ImageComponent changed incompatible by removing alternative preview image.
It's returning a list of links to components using an alternative preview image. Check which components have to updated after updating kwf.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$data = Kwf_Registry::get('db')->query('SELECT * FROM `kwc_basic_image` WHERE data like \'%preview_image":true%\'')->fetchAll(); | |
foreach ($data as $row) { | |
$component = Kwf_Component_Data_Root::getInstance()->getComponentByDbId($row['component_id'], array('ignoreVisible' => false)); | |
if ($component) { | |
if ($component->componentClass != 'Kwc_Basic_LinkTag_Empty_Component') { | |
if ($component->getComponent()->getRow()->kwf_upload_id) { | |
//d($component->componentClass); | |
$components[$component->getAbsoluteUrl()] = '<a href="'.$component->getAbsoluteUrl().'">'.$component->getAbsoluteUrl().'</a>'; | |
} | |
} | |
// $components[] = $component->getUrl(); | |
} | |
} | |
d(array_values($components)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment