Roman Prisiazniuk |
01-28-2016 01:34 AM |
Clone slots functionality
I just wrote a module that adds Clone button to 'admin.php?target=slots'. This button copies selected slots(including their images, default products, including products...).
But after upgrade to 5.2.11 xcart version clone button do not copy images(image link is broken).
When I look into log file(/var/log/xlite.log.2016-01-28.php) I see this error:
Code:
Jan 28 10:22:14 XLite [error] Unable to get at the contents of 'https://37.48.94.34/xcart/images/slots/t-shirt-icon.png'.
Runtime id: 8c794e976694c29259b9b253cdea3182;
Server API: apache2handler; IP: 88.135.80.93;
Request method: POST;
URI: /xcart/admin.php?target=slots;
Backtrace:
file <compiled classes repository>/classes/XLite/Model/Base/Image.php : 160
file <compiled classes repository>/classes/XLite/Module/Romas/CloneSlots/Controller/Admin/Slots.php : 84
file <compiled classes repository>/classes/XLite/Controller/AControllerAbstract.php : 1370
file <compiled classes repository>/classes/XLite/Controller/Admin/AAdmin.php : 269
file <compiled classes repository>/classes/XLite/Controller/AControllerAbstract.php : 1389
file <compiled classes repository>/classes/XLite/Controller/AControllerAbstract.php : 557
file <compiled classes repository>/classes/XLite/Module/QSL/CloudSearch/Controller/AController.php : 49
file <compiled classes repository>/classes/XLite/Controller/Admin/AAdmin.php : 164
file <compiled classes repository>/classes/XLiteAbstract.php : 604
file <compiled classes repository>/classes/XLiteAbstract.php : 629
file <X-Cart root>/admin.php : 39
84th line of /classes/XLite/Module/Romas/CloneSlots/Controller/Admin/Slots.php corresponds to this code snippet "$new_img = $img->cloneEntity();" :
PHP Code:
$img = $slot->image; if($img){ $new_img = $img->cloneEntity(); $new_img->slot = $new_slot; \XLite\Core\Database::getEM()->persist($new_img); \XLite\Core\Database::getEM()->flush(); }
Please help me to resolve this issue!
Thanks.
|