Jump to content
thirty bees forum
  • 0

Printful Module Question


Question

Posted

Hello,

I tried to add product to my site using the Printful module after upgrading to TB 1.6 and it returned a 500 error and said the product was not added.  I checked the site and it actually added the product but without combinations.  The PHP error log is as follows:

Message:

ValueError: str_repeat(): Argument #2 ($times) must be greater than or equal to 0

Location:

classes/webservice/WebserviceOutputBuilder.php line 829

It appears to be a problem with adding the images.

I reached out to the Printful customer service and after sending it to their "Team" they told me that the problem is on my end.

The only problem is in adding new product.  Orders are syncing with Printful and they are updating shipping information correctly.

Any help would be greatly appreciated.

Laura

12 answers to this question

Recommended Posts

  • 0
Posted

After some research I found out that the error was caused by the php version.  The Printful module will not work with anything higher than 7.4.

  • 0
Posted (edited)
8 hours ago, datakick said:

Hi, 

can you post the stacktrace from the error message?

This does not look like a bug in module, but like a bug in the core.

I got it working on TB 1.6.0 php version 7.4  The error is still there but has been downgraded to a warning.

This is the stacktrace:

#0  builtin
#1  classes/webservice/WebserviceOutputBuilder.php(829): str_repeat("\t", -1)
#2  classes/webservice/WebserviceOutputBuilder.php(570): WebserviceOutputBuilderCore->setIndent(1)
#3  classes/webservice/WebserviceSpecificManagementImages.php(1234): WebserviceOutputBuilderCore->renderEntity(Image#1, 1)
#4  classes/webservice/WebserviceSpecificManagementImages.php(947): WebserviceSpecificManagementImagesCore->writePostedImageOnDisk("", null, null, array(17), "/home/customer/www/stargeezerstuff.com/public_html/img/p/")
#5  classes/webservice/WebserviceSpecificManagementImages.php(649): WebserviceSpecificManagementImagesCore->manageDeclinatedImagesCRUD(false, "", array(17), "/home/customer/www/stargeezerstuff.com/public_html/img/p/")
#6  classes/webservice/WebserviceSpecificManagementImages.php(728): WebserviceSpecificManagementImagesCore->manageEntityDeclinatedImages("/home/customer/www/stargeezerstuff.com/public_html/img/p/", array(17))
#7  classes/webservice/WebserviceSpecificManagementImages.php(739): WebserviceSpecificManagementImagesCore->manageDeclinatedImages("/home/customer/www/stargeezerstuff.com/public_html/img/p/")
#8  classes/webservice/WebserviceSpecificManagementImages.php(361): WebserviceSpecificManagementImagesCore->manageProductImages()
#9  classes/webservice/WebserviceSpecificManagementImages.php(226): WebserviceSpecificManagementImagesCore->manageImages()
#10 classes/webservice/WebserviceRequest.php(633): WebserviceSpecificManagementImagesCore->manage()
#11 webservice/dispatcher.php(102): WebserviceRequestCore->fetch("fdecdc63747f250c2d33c089db648b26", "POST", "images/products/250", array(0) [], false, "")
Edited by jnsgioia
  • 0
Posted

This is the stacktrace with TB 1.6 php version 8.0 and higher (I tried it on a couple of versions)

#0  classes/webservice/WebserviceOutputBuilder.php(829)
#1  classes/webservice/WebserviceOutputBuilder.php(829): str_repeat("\t", -1)
#2  classes/webservice/WebserviceOutputBuilder.php(570): WebserviceOutputBuilderCore->setIndent(1)
#3  classes/webservice/WebserviceSpecificManagementImages.php(1234): WebserviceOutputBuilderCore->renderEntity(Image#1, 1)
#4  classes/webservice/WebserviceSpecificManagementImages.php(947): WebserviceSpecificManagementImagesCore->writePostedImageOnDisk("", null, null, array(17), "/home/customer/www/stargeezerstuff.com/public_html/img/p/")
#5  classes/webservice/WebserviceSpecificManagementImages.php(649): WebserviceSpecificManagementImagesCore->manageDeclinatedImagesCRUD(false, "", array(17), "/home/customer/www/stargeezerstuff.com/public_html/img/p/")
#6  classes/webservice/WebserviceSpecificManagementImages.php(728): WebserviceSpecificManagementImagesCore->manageEntityDeclinatedImages("/home/customer/www/stargeezerstuff.com/public_html/img/p/", array(17))
#7  classes/webservice/WebserviceSpecificManagementImages.php(739): WebserviceSpecificManagementImagesCore->manageDeclinatedImages("/home/customer/www/stargeezerstuff.com/public_html/img/p/")
#8  classes/webservice/WebserviceSpecificManagementImages.php(361): WebserviceSpecificManagementImagesCore->manageProductImages()
#9  classes/webservice/WebserviceSpecificManagementImages.php(226): WebserviceSpecificManagementImagesCore->manageImages()
#10 classes/webservice/WebserviceRequest.php(633): WebserviceSpecificManagementImagesCore->manage()
#11 webservice/dispatcher.php(102): WebserviceRequestCore->fetch("fdecdc63747f250c2d33c089db648b26", "POST", "images/products/242", array(0) [], false, "")
  • 0
Posted
1 minute ago, datakick said:

Since this is a bug in core, module update won't help. 

@jnsgioia this is fixed in bleeding edge. You can try to update your store, and retest

Thank you.

Which php version should I use?

  • 0
Posted
18 minutes ago, datakick said:

Since this is a bug in core, module update won't help. 

@jnsgioia this is fixed in bleeding edge. You can try to update your store, and retest

I updated to the bleeding edge and  php version 8.2 and retested the module.  Everything worked without warnings or errors!!  Thank you very much.

However, when I checked the configuration information after the update the following showed.

Some required tests failed

Install the 'yaml' PHP extension on your server.

I do not see that extension as an option.  Do I need to contact my hosting customer service for this?

  • 0
Posted
1 hour ago, jnsgioia said:

Install the 'yaml' PHP extension on your server.

I do not see that extension as an option.  Do I need to contact my hosting customer service for this?

yes, you should.

At the moment it's not critical, this requirement is for future features. But it's better to be prepared 

  • 0
Posted
7 minutes ago, datakick said:

yes, you should.

At the moment it's not critical, this requirement is for future features. But it's better to be prepared 

Thank you I have reached out to them and they are working on it.

  • 0
Posted
1 hour ago, datakick said:

yes, you should.

At the moment it's not critical, this requirement is for future features. But it's better to be prepared 

Hi,

This is the response I received:

YAML PHP Extension is not within the set of available extensions that can be enabled and if you want to install it for your website, you can do that manually and use it from a Local folder.

How soon I need to do this?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...