plug-in CB Blogs - changes the alias of the text?

9 months 2 days ago - 9 months 2 days ago #302025 by warlocksp
Good afternoon,
Tell me please,

Question:
When a user creates a blog, everything is fine.
After editing, does the alias of the text change?

Example:
When creating it turns out: /blog/###/testirovanie-bloga
Click edit and save , it turns out: /blog/###/testirovanie-bloga-2
Each time it is alternated with "-2" or without it.

That is, "-2" is added to the alias of the text
8 months 2 weeks ago #302373 by warlocksp
The answer is:
www.joomlapolis.com/forum/198-cb/238564-plug-in-cb-blogs-changes-alias-text
********************
This block of code in the file "plug_cbblogs\models\joomla25.php":
while ( $table->load( array( 'alias' => $alias, 'catid' => $article->get( 'catid' ) ) ) ) {
$matches = null;

if ( preg_match( '#-(\d+)$#', $alias, $matches ) ) {
$alias = preg_replace( '#-(\d+)$#', '-' . ( $matches[1] + 1 ). '', $alias );
} else {
$alias .= '-2';
}
}

Delete:
else {
$alias .= '-2';
}

And there will be happiness.
Moderators: beatnantkrileon
Time to create page: 0.355 seconds
Facebook Twitter Google LinkedIn