Skip to main content
Topic: [ADDON][beta] Topic Prefix (Read 110230 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: [ADDON][beta] Topic Prefix

Reply #60

Yep, I confirm that the version you just posted solves my problem 8)

But the problem I mentioned at post n° 50 is still present. To explain it better you can see it in my live forum.
Go to skodaclub.it/index.php?board=12.0
as you can see there are less than 30 topics
if on that board you select first prefix called "motore" (link skodaclub.it/index.php?action=prefix;sa=prefixedtopics;id=1;board=12 ) you will see that there are only 2 topics with that prefix, but there are also 7 pages available. If you click on page 2 (link skodaclub.it/index.php?action=prefix;sa=prefixedtopics;id=1.%1$d;start=15 ) you will see a list of topics with the same prefix called "motore" but from other boards.
Screenshot_2020-01-18 Prefisso multimedia - pagina 1.png
I don't know if this is intended or not, I hope not  ::)

=== edit ===
I think I found another one, If I have a topic with a prefix, and I edit the first post choosing "no prefix" and save, I still see the old prefix applied.
On the same topic if I try to change the prefix editing the first post I get an error "The database value you're trying to insert does not exist: new_prefix". In elkarte log I see:
Type of error: Critical
The database value you're trying to insert does not exist: new_prefix
Function: runQuery
File: /sources/subs/TopicPrefixTcCRUD.class.php
Line: 84

IIRC this was working on the previous version, but I'm not 100% sure.
Last Edit: January 20, 2020, 04:01:32 pm by radu81
sorry for my bad english

Re: [ADDON][beta] Topic Prefix

Reply #61

I see that .... humm .... Well thats a bit of a bugger.  Clearly a glutton for punishment so try this.
Last Edit: January 20, 2020, 06:50:06 pm by Spuds

Re: [ADDON][beta] Topic Prefix

Reply #62

Quote from: radu81 – === edit ===
I think I found another one, If I have a topic with a prefix, and I edit the first post choosing "no prefix" and save, I still see the old prefix applied.
Just did this on my local and the prefix was removed as expected :(
Quote from: radu81 – On the same topic if I try to change the prefix editing the first post I get an error "The database value you're trying to insert does not exist: new_prefix". In elkarte log I see:
Type of error: Critical
The database value you're trying to insert does not exist: new_prefix
Function: runQuery
File: /sources/subs/TopicPrefixTcCRUD.class.php
Line: 84

IIRC this was working on the previous version, but I'm not 100% sure.
That error I also see  :'(

Re: [ADDON][beta] Topic Prefix

Reply #63

It's getting better with every update, I confirm that the problem with page numbers and topics from other boards is now solved. 8)

For the other error I am almost sure it worked on the previous version. Thanks again for your help.
sorry for my bad english

Re: [ADDON][beta] Topic Prefix

Reply #64

Quote from: radu81 – It's getting better with every update, I confirm that the problem with page numbers and topics from other boards is now solved. 8)

For the other error I am almost sure it worked on the previous version. Thanks again for your help.
I almost think I'm spinning my wheels LOL, glad you think its getting better.  Here is a version that should fix the removing / editing of prefixes from the post page.

ETA: Updates Below
Last Edit: January 28, 2020, 08:52:47 pm by Spuds

Re: [ADDON][beta] Topic Prefix

Reply #65

I confirm, changing or removing the prefix from first post edit is working fine now. 8)
sorry for my bad english

 

Re: [ADDON][beta] Topic Prefix

Reply #66

Spuds, don't hate me, but I found another one ::)
To replicate it:
- go to skodaclub.it/index.php?board=19.0
- choose the first prefix called "motore"
- you will see 3 pages of results and that should be correct
- click on page 2, you will get a page without topics, and the total pages are now 8 (8 pages of results are probably all topics from all boards with that prefix)
sorry for my bad english

Re: [ADDON][beta] Topic Prefix

Reply #67

And once more .... I did find a couple of additional issues that were certainly causing pagination issues .... could be more though !

Re: [ADDON][beta] Topic Prefix

Reply #68

I thought you forgot about this :D  I confirm that the last bug is gone now, thanks again for your help.
sorry for my bad english

Re: [ADDON][beta] Topic Prefix

Reply #69

Quote from: radu81 – I thought you forgot about this :D  I confirm that the last bug is gone now, thanks again for your help.
Nah .. I just had to look away for a short while :D

Re: [ADDON][beta] Topic Prefix

Reply #70

What do you think about adding the prefix in topic view (index.php?topic=x) near to the title and also on the list of unread posts and replies?
sorry for my bad english

Re: [ADDON][beta] Topic Prefix

Reply #71

Quote from: radu81 – prefix in topic view (index.php?topic=x) near to the title

This is working with Light theme, but not with BeSocial, seems there is a little bug reported here.

Also in message view I suggest to not display the prefix inside the number views ,but before the title. (The prefix will not be displayed on mobile view since the views are not displayed on mobile)
FIle: TopicPrefix.Integrate.php
Code: [Select]
			$context['num_views_text'] = sprintf($txt['topicprefix_linktree'], topicprefix_prefix_marktup($prefixes[$topic])) . ' ' . $context['num_views_text'];
should became something like
Code: [Select]
			$context['subject'] = sprintf(topicprefix_prefix_marktup($prefixes[$topic])) . $context['subject'];

my code is not  correct, it works but also creates an html error in quick reply (see screenshot). Any suggestion on how to solve this?

Re: [ADDON][beta] Topic Prefix

Reply #72

I get some errors in elkarte log using this add-on and PHP 7.3:

Type of error: Undefined
Notice: Undefined offset: 15365
index.php?action=post2;start=0;board=2
File: /sources/subs/TopicPrefixTcCRUD.class.php
Line: 204
Code: [Select]
return $this->deleteByTopicPrefix($id_topic, $current[$id_topic]['id_prefix']);
and there are more similar, same file, same line
Notice: Undefined offset: 15366
Notice: Undefined offset: 15370

Type of error: Undefined
Notice: Undefined index: is_first_post
/index.php?action=quotefast;quote=242607;xml
File: /sources/subs/TopicPrefix.class.php
Line: 55
Code: [Select]
if (!$context['is_first_post'])
This is probably a conflict with Quick Quote add-on
sorry for my bad english

Re: [ADDON][beta] Topic Prefix

Reply #73

Discovered this add-on recently, and would love to use it. After some fiddling I could make it to work with my non-default theme too.

I'm observing the very same error message in the log file:

Undefined offset: ...
File: .../sources/subs/TopicPrefixTcCRUD.class.php
    Line: 204

So far it looks like it doesn't affect the functionality in a bad way. Anyway, thought it would be good to confirm the problem. Please let me know how I could help with more/further information.

Re: [ADDON][beta] Topic Prefix

Reply #74

@emanuele‍ I unistalled the add-on and installed the version from github since you update it recently, but that makes the forum unusable, I don't remember exactly the error (it was a white page with an error in TopicPrefix.Integrate.php), I cannot see any topic or admin page, only the index page was working. I had to overwrite the file TopicPrefix.Integrate.php from https://www.elkarte.net/community/index.php?topic=1424.msg40565#msg40565 to make it working again.
Probably the best solution is to update the whole add-on on github using the version provided by Spuds on reply #67 of this topic.
sorry for my bad english