Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Clone slots functionality

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 01-28-2016, 01:34 AM
 
Roman Prisiazniuk Roman Prisiazniuk is offline
 

Member
  
Join Date: Jun 2015
Posts: 27
 

Default 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.
__________________
xcart5
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:41 AM.

   

 
X-Cart forums © 2001-2020