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

WS: Auto generate link_rewrite and do not require it when creating ca… #8769

Merged

Conversation

@marekhanus
Copy link
Contributor

commented Feb 18, 2018

Questions Answers
Branch? develop
Description? Generate link_rewrite when creating category via webservice
Type? improvement
Category? WS
BC breaks? no
Deprecations? no
Fixed ticket?
How to test? When creating category, if XML tag <link_rewrite> is empty, then PrestaShop generate it from category name. Same function as generating link_rewrite for products.

This change is Reviewable

@PierreRambaud

This comment has been minimized.

Copy link
Contributor

commented Nov 23, 2018

@Quetzacoalt91 Wdyt? I don't know this part :/

foreach ($this->name as $id_lang => $name) {
if (empty($this->link_rewrite[$id_lang])) {
$this->link_rewrite[$id_lang] = Tools::link_rewrite($name);
} elseif (!Validate::isLinkRewrite($this->link_rewrite[$id_lang])) {

This comment has been minimized.

Copy link
@PierreRambaud

PierreRambaud Jul 11, 2019

Contributor

Not sure it works because of the 'validate' in line 116

@Quetzacoalt91

This comment has been minimized.

Copy link
Member

commented Jul 11, 2019

Sorry I missed the ping. I'm fine with the idea, however we duplicate code from the Product class. I let you decide if we merge anyway.

@sarahdib sarahdib added this to the 1.7.7.0 milestone Jul 12, 2019

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2019

Hi @marekhanus,

I run those commands:
#git fetch origin pull/8769/head:feature/category-link-rewrite
#git checkout feature/category-link-rewrite

The checkout to your Branch occurs an exception
image

The Branch develop is OK, it occurs only with your Branch.
Thanks to check & feedback.

@PierreRambaud

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2019

@khouloudbelguith The branch must be rebased with the current develop. This could be a conflicts with an old dependency. Do you run composer install?

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2019

@PierreRambaud, when I run composer install, the version PrestaShop is decreasing.

Thanks!

@marekhanus marekhanus force-pushed the marekhanus:feature/category-link-rewrite branch from f07312f to 65ba936 Jul 12, 2019

@marekhanus marekhanus requested a review from PrestaShop/prestashop-core-developers as a code owner Jul 12, 2019

@marekhanus marekhanus force-pushed the marekhanus:feature/category-link-rewrite branch from 65ba936 to 61d1327 Jul 12, 2019

@marekhanus marekhanus force-pushed the marekhanus:feature/category-link-rewrite branch from 61d1327 to ff615e4 Jul 12, 2019

@marekhanus marekhanus force-pushed the marekhanus:feature/category-link-rewrite branch from ff615e4 to 110e75e Jul 12, 2019

@marekhanus

This comment has been minimized.

Copy link
Contributor Author

commented Jul 12, 2019

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

commented Jul 17, 2019

Hi @marekhanus,

Now, it is OK.
The link_rewrite is not required while adding a category, it is automatically generated.

Thanks!

@PierreRambaud PierreRambaud merged commit 9d783b6 into PrestaShop:develop Jul 17, 2019

2 checks passed

PrettyCI Code formatting
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@PierreRambaud

This comment has been minimized.

Copy link
Contributor

commented Jul 17, 2019

Thanks @marekhanus

mbadrani added a commit to mbadrani/PrestaShop that referenced this pull request Jul 18, 2019

Merge pull request PrestaShop#8769 from marekhanus/feature/category-l…
…ink-rewrite

WS: Auto generate link_rewrite and do not require it when creating ca…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.