Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Product page truncates features #5

Closed
piel17 opened this issue Jul 28, 2015 · 14 comments
Closed

Product page truncates features #5

piel17 opened this issue Jul 28, 2015 · 14 comments

Comments

@piel17
Copy link

piel17 commented Jul 28, 2015

Hello,
I have installed your module and it works almost perfectly.
I met success for growing up the features values length but product page truncate the "$feature.value" string and I don't understand why. (~350 characters)
Can you help mee with this ?
PS: I'm using Prestashop 1.6.1.0

@jdanthinne
Copy link
Owner

Hi! Where exactly is the truncated string? Screenshot welcome.

@piel17
Copy link
Author

piel17 commented Jul 28, 2015

front
front-code
back-features-values

This is the front product page. I tried to replace the SEPARATOR value in the db query in Product.php but that didn't change anything except the features text is truncating somewhere else.
The third image show you that my features values are correctly save.

@piel17 piel17 closed this as completed Jul 28, 2015
@piel17 piel17 reopened this Jul 28, 2015
@jdanthinne
Copy link
Owner

I've just checked, and nothing in my code is truncating the results… Are you using a custom theme (which one?) that could truncate the results?

@kpawel
Copy link

kpawel commented Aug 24, 2015

piel17, you found solution?

@kpawel
Copy link

kpawel commented Sep 3, 2015

@jdanthinne I found reason why values are truncate.

But i need your help.

You used in module function group_concat and this function have lenght limit in default 1024.
With utf-8 formatting it's about 350 chars.

For fix this we need use this:
set session group_concat_max_len = 4096

But i don't know where place this in product class.
I tried in few places but without success, every time some errors.

PS. I don't have acces to server conf file to change it permamently.

@jdanthinne
Copy link
Owner

Where is this group_concat function in my module? I can't find it.

@kpawel
Copy link

kpawel commented Sep 3, 2015

override\classes\product.php

Line 51
SELECT name, GROUP_CONCAT(value ORDER BY fv.position SEPARATOR ", ") AS value, pf.id_feature

@jdanthinne
Copy link
Owner

You're right, I was searching in PHP code instead of MySQL :-).
I've juste created a branch https://github.com/jdanthinne/advancedfeaturesvalues/tree/issue%235 with a fix that set a bigger length. Can you try that please and tell if it's ok?

@kpawel
Copy link

kpawel commented Sep 4, 2015

empty

Empty field where before was table.

@jdanthinne
Copy link
Owner

Is it on a live server, or a testing server? Perhaps some servers are limiting the use of SET SESSION… In this case, I need to completely rewrite the SQL query to manually concatenate all the values.

@kpawel
Copy link

kpawel commented Sep 4, 2015

On live server. I wrote also to hosting support for change global limit but i don't know if they will do it.

@jdanthinne
Copy link
Owner

I've just made a change and set the max length in a separate query. Can you try that? 0d3f7e6

@kpawel
Copy link

kpawel commented Sep 4, 2015

Now it works perfectly! Good Job :)

Thank you very much :)

@jdanthinne
Copy link
Owner

Good! Merged changes to the master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants