in my local config, which generally works, but fails on numeric tags where it falls back to id-tag, for example instead of "2015" the tag "88-2015" is in the underlying URL. I wouldn't mind that much if clicking such would actually lead to the group of images tagged with "2015", but instead it gives "Page not found" and then redirects to the tags.php page. I reckon that probably the id is prefixed because of an alleged ambiguity of numeric tag name and numeric tag id, but then it should actually work.. Note that removing the "id-" part from the URL so that only the actual numeric tag is left works fine and the corresponding tagged images are displayed.
I have
`$conf['tag_url_style'] = 'tag';`
in my local config, which generally works, but fails on numeric tags where it falls back to id-tag, for example instead of "2015" the tag "88-2015" is in the underlying URL. I wouldn't mind that much if clicking such would actually lead to the group of images tagged with "2015", but instead it gives "Page not found" and then redirects to the tags.php page. I reckon that probably the id is prefixed because of an alleged ambiguity of numeric tag name and numeric tag id, but then it should actually work.. Note that removing the "id-" part from the URL so that only the actual numeric tag is left works fine and the corresponding tagged images are displayed.
<!-- github-sync-id:114418177 -->
I don't understand why the id would be appened. If the conf is "tag" then it's undoubtedly the "url_name", not the "id".
@plegall ?
About your workaround, you'd better use $requested_tag_ids[] = $matches[1]; on line 526, use the id when it's available (database lookup is faster).
But I'm not sure it's the right solution.
I don't understand why the id would be appened. If the conf is "tag" then it's undoubtedly the "url_name", not the "id".
@plegall ?
---
About your workaround, you'd better use `$requested_tag_ids[] = $matches[1];` on line 526, use the id when it's available (database lookup is faster).
But I'm not sure it's the right solution.
<!-- github-comment-id:152745794 -->
@mistic100
In function make_section_in_url() at line 381 there's
case 'tag':
if (isset($tag['url_name']) and !is_numeric($tag['url_name']) )
{
$section_string.= '/'.$tag['url_name'];
break;
}
default:
$section_string.= '/'.$tag['id'];
if (isset($tag['url_name']))
{
$section_string.= '-'.$tag['url_name'];
}
so for a numeric url_name it falls through to the default case where $tag['id'].'-'.$tag['url_name'] is combined.
I also thought about $requested_tag_ids[] = $matches[1]; but then for a real "12-34" tag it might be better to not find a resulting "34" URL than finding a wrong "12" id that might exist.
@mistic100
In function make_section_in_url() at line 381 there's
```
case 'tag':
if (isset($tag['url_name']) and !is_numeric($tag['url_name']) )
{
$section_string.= '/'.$tag['url_name'];
break;
}
default:
$section_string.= '/'.$tag['id'];
if (isset($tag['url_name']))
{
$section_string.= '-'.$tag['url_name'];
}
```
so for a numeric url_name it falls through to the default case where `$tag['id'].'-'.$tag['url_name']` is combined.
I also thought about `$requested_tag_ids[] = $matches[1];` but then for a real "12-34" tag it might be better to not find a resulting "34" URL than finding a wrong "12" id that might exist.
<!-- github-comment-id:152751517 -->
The best would probably be to not prepend the id and then remove the workaround, but as said in the commit message, I don't know what implications that may have in places where make_section_in_url() is called.
The best would probably be to not prepend the id and then remove the workaround, but as said in the commit message, I don't know what implications that may have in places where make_section_in_url() is called.
<!-- github-comment-id:152751827 -->
I created a new fork from scratch and issued a new pull request with the IMHO proper fix. https://github.com/Piwigo/Piwigo/pull/371
<!-- github-comment-id:154859208 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
I have
$conf['tag_url_style'] = 'tag';in my local config, which generally works, but fails on numeric tags where it falls back to id-tag, for example instead of "2015" the tag "88-2015" is in the underlying URL. I wouldn't mind that much if clicking such would actually lead to the group of images tagged with "2015", but instead it gives "Page not found" and then redirects to the tags.php page. I reckon that probably the id is prefixed because of an alleged ambiguity of numeric tag name and numeric tag id, but then it should actually work.. Note that removing the "id-" part from the URL so that only the actual numeric tag is left works fine and the corresponding tagged images are displayed.
I don't understand why the id would be appened. If the conf is "tag" then it's undoubtedly the "url_name", not the "id".
@plegall ?
About your workaround, you'd better use
$requested_tag_ids[] = $matches[1];on line 526, use the id when it's available (database lookup is faster).But I'm not sure it's the right solution.
@mistic100
In function make_section_in_url() at line 381 there's
so for a numeric url_name it falls through to the default case where
$tag['id'].'-'.$tag['url_name']is combined.I also thought about
$requested_tag_ids[] = $matches[1];but then for a real "12-34" tag it might be better to not find a resulting "34" URL than finding a wrong "12" id that might exist.I know where it's done, I just don't understand why.
And please don't close, it's not solved.
The best would probably be to not prepend the id and then remove the workaround, but as said in the commit message, I don't know what implications that may have in places where make_section_in_url() is called.
I created a new fork from scratch and issued a new pull request with the IMHO proper fix. https://github.com/Piwigo/Piwigo/pull/371