Jump to content

Advanced Tags & Prefixes - IPS 4.x


Ryan H.

Recommended Posts

Do you think it´s possible to convert my existing tags to prefixes? If that is the case I can do without min/max tags settings per forum.

If you can identify them in the database, look at table core_tags, column 'prefix' (or such). You can change the values there, and then run the rebuild cache tool in my app.

Link to comment
Share on other sites

@Ryan H. Can I just ask - how is the plugin supposed to handle RSS imports where that forum that the thread is imported to is required to have tags - what is supposed to happen as I have a support ticket open with IPS at the moment regarding duplicate RSS topics being made many times over and @Ryan Ashbrook has posed the question;

Hello,

Actually, it is throwing an error, however the problem is that it is not being logged as such - I have fixed that.

The error being thrown is this one, actually:

Column 'tag_member_id' cannot be null
Have you installed or configured any add-ons recently to add a tag to an imported topic? That isn't actually default functionality.

I've also added some additional logging to store a backtrace, that I can examine to see where precisely the problem is, the next time this occurs.

Regards,

Ryan Ashbrook
Invision Power Services, Inc.

 

Link to comment
Share on other sites

@Ryan H. Can I just ask - how is the plugin supposed to handle RSS imports where that forum that the thread is imported to is required to have tags - what is supposed to happen as I have a support ticket open with IPS at the moment regarding duplicate RSS topics being made many times over and @Ryan Ashbrook has posed the question;

 

I'll investigate. It most likely is coming from my app, not clear to me why that would be though.

Link to comment
Share on other sites

It occurs if tagging mode in System -> Setings -> Posting -> Tags is set to "Closed". When it's set to "Open it works.

Open: Users can use whatever tags they like <- Works.
Closed: Users must choose from a specified set of tags <- When set to "Closed" tags don't show or keep its setting in posts.

I really can't reproduce this at all. Maybe I don't understand what is going wrong for you.

Found a prefix bug in 3.0.6 (30006): ... On edit, the original prefix is still in the populated editor dropdown but doesn't seem to save. When I go back to edit again (2nd time after the prefix has disappeared) the dropdown is showing no prefix. If this is related to open/close settings etc LMK and I can get you those.

Fixed for next release.

When choosing a default prefix, there's no option to select whatever is the first prefix in the allowed list (and yes, I did already click Save to refresh the list of available prefixes).  See screenshot.

I could not reproduce this. Fresh install, one prefix, set on the one forum, shows up in the default dropdown. Are you absolutely certain 'vintage' is actually defined as a prefix?

Question - when using the Saved Action on the selected topics to add a tag does any one know if this is smart enough to prevent duplicates (i haven't tried yet )

Tested and couldn't find any issue, but I added some code to make sure of that regardless.

I'm not sure if the tool will purposely check for a duplicate, but in general I don't think the mod does.  The reason why is that I've batch modified tags, and that sometimes creates duplicate tags.  

Referring to the Manage Tags section, not the mass-add tags/prefixes tool? That could happen if you change one tag to merge with another (but a topic is tagged with both). Handling that would require a much more complex and intensive process than I'm using right now, which is effectively a find/replace query. By any other means, duplicate tags should be handled fine.

Bedtime now, I'm afraid. I'll continue from Angus90's post another day.

Link to comment
Share on other sites

I'll investigate. It most likely is coming from my app, not clear to me why that would be though.

I solved this bug in my Rules application as I was getting the same error when certain rules were set up to change/update tags on content. The problem is with the setTags() method on the content item class. In the method it has a direct reference to \IPS\Member::loggedIn()->member_id, which will be null if there is not a currently logged in member (such as an RSS import).

The solution is to check if there is a logged in member before attempting to set the tags, and if not, temporarily assign a value to the \IPS\Member::loggedIn()->member_id property ( such as '0' ). This will allow the tag to be saved. And then set it back to null after performing the operation.

Link to comment
Share on other sites

The solution is to check if there is a logged in member before attempting to set the tags, and if not, temporarily assign a value to the \IPS\Member::loggedIn()->member_id property ( such as '0' ). This will allow the tag to be saved. And then set it back to null after performing the operation.

You da best. And stateful content creation is silly. Thanks.

Link to comment
Share on other sites

I was able to convert all of my tags to prefixes ... thanks for the hint! But is it really necessary that "Allowed Prefixes" are sorted alphabetically/numeric? 

Because my prefixes are products, I prefer a manual sorting (within the drop-down menu)

Edited by Angus90
Link to comment
Share on other sites

I was able to convert all of my tags to prefixes ... thanks for the hint! But is it really necessary that "Allowed Prefixes" are sorted alphabetically/numeric? 

Because my prefixes are products, I prefer a manual sorting (within the drop-down menu)

I'll check, but I think that's enforced by IPS. Kind of out of my control unless I make larger changes.

empty tags? - Been noticing there are several posts that have blank tags even though the setting requires at least 2 characters.

If anyone can pinpoint where they're coming from, I'll make sure they're taken care of. I have a couple changes in store already that might help.

Link to comment
Share on other sites

  • 2 weeks later...

So this is a weird issue (I'm on an upgrade @Ryan H.) but on forums that don't have prefixes setup I'm getting given two prefixes that are not setup on them. I've checked to be sure that there are no "prefixes" for those forums but because prefixes are enabled they still show.

Sorry, could you clarify? No prefixes in 'allowed prefixes' on a given forum, but the prefix dropdown still displays on posting? Do you have tags or prefixes disabled there? Do you have global predefined tags? (Do they match?)

Link to comment
Share on other sites

Yes and No.

In the forum prefixes are allowed but I have no defined prefixes for that forum (the prefix list is empty).

I do have globally defined tags but not even all of them are in there (There are four and only two show up)

I couldn't tell you if they are setup as "global" prefixes because I legit just spent twenty minutes looking for such a setting and can't find one.

Link to comment
Share on other sites

I really can't reproduce this at all. Maybe I don't understand what is going wrong for you.

I wanted to follow up. I disabled the mod, updated to the latest version, enabled the mod, set global tags to close, configured the prefix settings and forum settings, and it appears to be working properly now. :smile: I'll continue to monitor it.

Link to comment
Share on other sites

2) Not sure if its related to ips or to this addon, nevertheless I ask you first ... I wanted to use the "copy value" feature of defined tags. Everything seems to be ok but after checking the target no data is copied. 

I couldn't reproduce this on 4.0.11. Might have been a core bug since fixed?.

@Ryan H. Can I just ask - how is the plugin supposed to handle RSS imports where that forum that the thread is imported to is required to have tags - what is supposed to happen as I have a support ticket open with IPS at the moment regarding duplicate RSS topics being made many times over and @Ryan Ashbrook has posed the question;

I think I have a fix for this now, based on Kevin's guidance. Having trouble with dev mode on the latest version though, so I'm afraid I can't test it properly or build it for release just yet.

Yes and No.

In the forum prefixes are allowed but I have no defined prefixes for that forum (the prefix list is empty).

I do have globally defined tags but not even all of them are in there (There are four and only two show up)

I couldn't tell you if they are setup as "global" prefixes because I legit just spent twenty minutes looking for such a setting and can't find one.

Okay. It's kind of complicated, but I think it's working as intended. The 'allowed prefixes' and 'defined tags' inputs on forums are one and the same internally. I split them apart on the forum form to try making it easier to understand. If no tags/prefixes are defined explicitly on a forum, it will automatically inherit the global predefined tags (if any). And because tags and prefixes are both stored there, if any of those global predefined tags are set up as formatted prefixes, they will be treated as prefixes. I would hazard a guess that two of those four global tags have prefixes associated with them, and the other two do not.

What does that mean for you? You can fix it one of two ways. One, remove the global predefined tags and set them all per content container as needed. Or two, go into those affected forums and either define more proper tags, or change the tag mode there to remove the tag or prefix inputs for that forum.

I know where the blank tags are coming from (it's related to my bug) if you don't choose a prefix it will create a blank tag.

Okay, thanks. That should be fixed for the next update.

Link to comment
Share on other sites

What does that mean for you? You can fix it one of two ways. One, remove the global predefined tags and set them all per content container as needed. Or two, go into those affected forums and either define more proper tags, or change the tag mode there to remove the tag or prefix inputs for that forum.

There is a problem here. All four globally defined prefixes are also set in your mod. I'd be happy to remove them (I only added them as the mod hadn't been updated when I updated to the new software) but this doesn't explain why only 2/4 show.

To add insult to injury this also doesn't explain why prefixes that are currently set that equal values of prefixes before I upgraded, didn't change over to my prefix settings.

http://distant-fantasies.net/forum/72-chat-discussion/

Note that there are 2 tags that are "Roleplay" that I actually changed via this mod to the "roleplay" tag but something caused them to not match (likely capital letter).

More annoying is what I title a tag is auto-converted to lowercase so in a drop down instead of showing me the "Roleplay" it shows me "roleplay" which is just ugly to look at.

Link to comment
Share on other sites

There is a problem here. All four globally defined prefixes are also set in your mod. I'd be happy to remove them (I only added them as the mod hadn't been updated when I updated to the new software) but this doesn't explain why only 2/4 show.

"I would hazard a guess that two of those four global tags have prefixes associated with them, and the other two do not." You say all four have prefixes, but they may not match exactly. See below.

To add insult to injury this also doesn't explain why prefixes that are currently set that equal values of prefixes before I upgraded, didn't change over to my prefix settings.

http://distant-fantasies.net/forum/72-chat-discussion/

Note that there are 2 tags that are "Roleplay" that I actually changed via this mod to the "roleplay" tag but something caused them to not match (likely capital letter).

Prefixes are case-sensitive. If what is on the topic does not exactly match, it will not be considered the same. It's always been that way. If you want to make things consistent, use the 'Manage Tags' admin tool and edit all instances of one to match the other.

More annoying is what I title a tag is auto-converted to lowercase so in a drop down instead of showing me the "Roleplay" it shows me "roleplay" which is just ugly to look at.

Then you have the global tag settings set to force all tags to lowercase. If you do not have it set to force all tags to lowercase, all tags will not be forced to lowercase. That setting is under Posting > Tags.

Alternatively, if you want everything to be lowercase (easy way to keep everything consistent), there's an advanced tool in the app to convert all settings and existing tags/prefixes to lowercase as well.

 

I noticed this today

What task? I have no idea what would be generating JSON for this app.

Link to comment
Share on other sites

Well I guess, then, I'm confused. Previously you could have your display name which could have proper capitalization, and then the tag itself would still obey the rules. So if the tag was "Roleplay" but the converted tag was "roleplay" then in the prefix list it would show "Roleplay" but the actual tag itself would be 'roleplay' which made for decent formatting. If it's changed it's frustrating. I'm a part of a writing community and offering improperly formatted words is... and will be problematic.

What this tells me is that I need to go through my tags and re-save them all so that they all meet this criteria but it doesn't change the fact that it's ugly to look at 'roleplay' in a drop down when it was 'Roleplay' before.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...