Item11334: NewLdapUserTemplate displays %META:TOPICINFO at top of each new user topic

pencil
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: NewUserPlugin
Branches: trunk
Reported By: AaronFuleki
Waiting For:
Last Change By: MichaelDaum
I just did a clean install of FW1.1.4RC2, configured ldap logins, installed NewUserPlugin, and set NewLdapUserTemplate in my site preferences. Upon logging in with an LDAP user, I see the %META:TOPICINFO line with the template revision info at the top of the newly-created user topic.

-- AaronFuleki - 06 Dec 2011

The 1.1.4 store is much more strict on some things - one is that the %META:TOPICINFO must be the first line in the file, and cannot be provided in topic data. It had been possible to corrupt topics by embedding a TOPICINFO line in the topic.

Please view the topic using ?raw=debug in the URL. I expect that there are actually two META:TOPICINFO lines. I expect that the fix is to change ./lib/Foswiki/Plugins/NewUserPlugin.pm from using the deprecated Func::readTopicText to instead use Func::readTopic. This function does not return embedded metadata. Either that or a regex is needed to remove the TOPICINFO line from the returned template topic before writing out the new user topic.

For example:
     $text =~ s/^%META:TOPICINFO{.*?}%$//m;

-- GeorgeClark - 06 Dec 2011

Hmm. Well, the first thing I did was just open the user's new topic in VIM, and there was only one META line, and it was the first one in the file. That was the line that was displayed in the browser.

I'll try creating some more tomorrow and see what happens.

-- AaronFuleki - 07 Dec 2011

Could you paste in (with a nop in the tag) the actual user's meta line that is being displayed? Or possibly attach an sanitized copy of the user topic to this task? The only way that TOPICINFO line should get shown is if it's not the first line of the topic, unless we have a more serious issue.

-- GeorgeClark - 07 Dec 2011

Thanks for all the help with this, George. The examples are attached below. You can see from JohnSmith.txt that there's clearly an extra %META% line at the top of the newly-created user topic. I tried removing the line from the template topic entirely, and that just borked the topic save action, methinks.

-- AaronFuleki - 07 Dec 2011

I think the code change I suggested - removing the TOPICINFO from the loaded template topic using a regex in the plugin will be the fix. The 2nd TOPICINFO in JohnSmith.txt is the copy from the NewLdapUserTemplate - has the same timestamp. You can't remove it from the NewUserTemplate directly as it is a topic.

-- GeorgeClark - 07 Dec 2011

Hmm. I changed line #141 of ./lib/Foswiki/Plugins/NewUserPlugin.pm to read like so:

my $text = Foswiki::Func::readTopic($tmplWeb, $tmplTopic);

and I still see the meta line in the output of all new user topics.

-- AaronFuleki - 02 Jan 2012

Anybody had a chance to take a look at this? I still see the issue.

-- AaronFuleki - 14 Jan 2012

I second the motion.....I'm having exactly the same issue as described by Aaron.

-- DeanSpicer - 15 Jan 2012

I have the same problem since 1.1.4, but I have the line on top of the complete page (even on top of the top bar) and only on User's pages (e.g. the page of HenningDampel).

-- HenningDampel - 19 Jan 2012
 
I Attachment Action Size Date Who Comment
BadNewLdapUserTemplate.pngpng BadNewLdapUserTemplate.png manage 114 K 07 Dec 2011 - 15:10 AaronFuleki Screenshot of borked up NewLdapUserTemplate output.
JohnSmith.txttxt JohnSmith.txt manage 343 bytes 07 Dec 2011 - 15:09 AaronFuleki Example of borked up NewLdapUserTemplate output.
NewLdapUserTemplate.txttxt NewLdapUserTemplate.txt manage 268 bytes 07 Dec 2011 - 15:11 AaronFuleki NewLdapUserTemplate from 11 Dec 2010 version of NewUserPlugin, for comparison purposes.
Topic revision: r13 - 20 Jan 2012, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy