Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Unclear text in Activity section for account creation

ojjuanojjuan New
edited February 2011 in Vanilla 2.0 - 2.8
If I create a new user account via the dashboard, new info is added to the activity section. However, the wording doesn't really make sense. As the account creator, the activity says

"new_username created an account for your."

if i log in as the new user, the entry says

"You created an account for account_creators_name."

where new_username and account_creators_name are usernames.

I tested on Vanilla 2.0.17.6 with a base install (no additional plugins, themes, etc.)
Tagged:

Comments

  • Options
    one bump attempt. anyone else also see this on their install?
  • Options
    Yes, I get this too. And on the activity panel for other users, it announces:
    "new_username created an account for account_creator's."

    I assume it should say...
    For the account creator: "You created an account for new_username"
    For the new user: "account_creator created an account for you."
    For everyone else: "account_creator created an account for new_username."

    I'm new at this, but I suspect you can change the text in the localization file. I'll look into it.
  • Options
    Yes - I suppose there is an incorrect reference in some localization file. I can't find where it is wrong, but to correct it, add the following lines to one of the locale definition files. (I put them in applications/dashboard/local/definitions.php, which seems to work, but I don't know if it is the "right" place for them.)

    $Definition['Activity.JoinCreated.FullHeadline'] = '%3$s created an account for %1$s.';
    $Definition['Activity.JoinCreated.ProfileHeadline'] = '%3$s created an account for %1$s.';

    For any problems with the text, look at the Baseline Locale files (http://vanillaforums.org/addon/baseline-locale). These have nearly all the text used in Vanilla, and the comments to that addon have a few additional text definitions. I think you can generally copy the corrected definitions into one of your existing locale definition files, even if you can't find the definition file with the wrong text.

    Someone explained in another thread that the codes in the localization files are as follows:
    %1$s = ActivityName
    %2$s = ActivityName Possessive
    %3$s = RegardingName
    %4$s = RegardingName Possessive
    %5$s = Link to RegardingName's Wall
    %6$s = his/her
    %7$s = he/she
    %8$s = route & routecode
    %9$s = gender suffix (some languages require this).

    If you look at the baseline locale captured.php file, you can probably find enough examples to figure out what you want.
  • Options
    edited July 2011
    After an hour of trying to figure out how to make it capitalize "you" when it says "you created an account for account_name." I gave up.

    My three attempts to work around this have been:
    $Definition['Activity.JoinCreated.FullHeadline'] = '%3$s created an account for %1$s.';
    $Definition['Activity.JoinCreated.FullHeadline'] = 'An account for %1$s was created by %3$s.';
    $Definition['Activity.JoinCreated.FullHeadline'] = '%2$s account was created by %3$s.';

    If I create an account for Bob, the first gives an "you created an account for Bob." on my page. The second gives "An account for You was created by JTadmin." on Bob's page. The third gives "You account was created by JTadmin." on Bob's page.

    I'm going with the first option, because only a few moderators will see the error. I can't think of anything that will be grammatically correct for both the user and the account creator.
  • Options
    edited August 2011
    The issue is with the database insertion. I haven't had enough time to look around to find the correct file to modify, but I have been able to determine that the ActivityUserID is being inserted into the RegardingUserID field and likewise, the RegardingUserID is being inserted into the ActivityUserID field.

    Also, creating new users is the only time the Add User screen hangs (upon clicking Save, the data is written, but the screen doesn't close). When editing an existing user, clicking Save, saves changes and closes the screen.
  • Options
    edited August 2011
    Even after reversing the entries in the database, there's still an issue. Now, as the ActivityUser, I see: You created an account for newusername's.

    == In structure.php, this entry... ==
    if ($SQL->GetWhere('ActivityType', array('Name' => 'JoinCreated'))->NumRows() == 0)
    $SQL->Insert('ActivityType', array('AllowComments' => '1', 'Name' => 'JoinCreated', 'FullHeadline' => '%1$s created an account for %4$s.', 'ProfileHeadline' => '%1$s created an account for %4$s.'));

    == should read... ==
    if ($SQL->GetWhere('ActivityType', array('Name' => 'JoinCreated'))->NumRows() == 0)
    $SQL->Insert('ActivityType', array('AllowComments' => '1', 'Name' => 'JoinCreated', 'FullHeadline' => '%1$s created an account for %3$s.', 'ProfileHeadline' => '%1$s created an account for %3$s.'));

    However, I suppose, for existing databases, you'd have to write a query to manually update the entries.
  • Options
    Modifying this file solves the problem:
    c:\wamo\www\vanilla\applications\dashboard\models\class.activitymodel.php

    ==This signature==
    Add($ActivityUserID, $ActivityType, $Story = ' ', $RegardingUserID = ' ', $CommentActivityID = ' ', $Route = ' ', $SendEmail = ' ')

    ==should read==
    public function Add($RegardingUserID = ' ', $ActivityType, $Story = ' ', $ActivityUserID, $CommentActivityID = ' ', $Route = ' ', $SendEmail = ' ')
  • Options
    edited August 2011
    I created the following sproc to run on databases which have already been affected by this bug.

    ------------------------------------------------------------------------
    -- Author: GeeksRock
    -- Note: This script can be used to reverse ActivityUserIDs and RegardingUserIDs.
    ------------------------------------------------------------------------

    DELIMITER $$

    CREATE PROCEDURE JoinCreatedIdReversal()
    BEGIN

    DECLARE maxActivityID INT(11) DEFAULT 1;
    DROP TABLE IF EXISTS ReverseUserEntries;

    CREATE TEMPORARY TABLE ReverseUserEntries
    SELECT
    gdn.ActivityID,
    gdn.CommentActivityID,
    gdn.ActivityTypeID,
    gdn.RegardingUserID AS 'ActivityUserIDReversal',
    gdn.ActivityUserID AS 'RegardingUserIDReversal',
    gdn.Story,
    gdn.Route,
    gdn.CountComments,
    gdn.InsertUserID,
    gdn.DateInserted
    FROM gdn_activity gdn;

    SELECT MAX(ActivityID) INTO maxActivityID FROM gdn_activity;
    SET maxActivityID = maxActivityID + 1;

    DELETE FROM gdn_activity WHERE ActivityID < maxActivityID;

    INSERT INTO gdn_activity
    (ActivityID,
    CommentActivityID,
    ActivityTypeID,
    ActivityUserID,
    RegardingUserID,
    Story,
    Route,
    CountComments,
    InsertUserID,
    DateInserted)
    SELECT * FROM ReverseUserEntries;

    END $$
    DELIMITER ;
Sign In or Register to comment.