Topic (or category item) url leads to home page in TOPIC.ADD email event

1 view
Skip to first unread message

Alexander Obuhovich

unread,
Jan 25, 2010, 10:48:50 AM1/25/10
to In-Portal Bugs
Topic (or category item) url leads to home page in TOPIC.ADD email event in case, when topic creation confirmation template is not used. This happens because just after topic (any other category item) is created it's CategoryId virtual field is not filled with current category (where topic was added to), but this CategoryId field is used later to build link to this topic in TOPIC.ADD email event.

To fix this you should set CategoryId field to $category_id (when passed) in kCatDBItem::assignPrimaryCategory() method (only when $category_id is not empty).
Originally discovered by DmitryA.

--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com

Dmitry Andrejev

unread,
Jan 25, 2010, 11:15:19 AM1/25/10
to in-port...@googlegroups.com
Hi Alex,

Here is a patch for this. Let me know if it looks good.

Cheers.

DA.

--
You received this message because you are subscribed to the Google Groups "In-Portal Bugs Team" group.
To post to this group, send email to in-port...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-bugs?hl=en.

Empty_CategoryId_In_Item_Object_After_ Its_Created-Dmitry-20100126-v1.patch

Dmitry A.

unread,
Jan 25, 2010, 11:37:03 AM1/25/10
to In-Portal Bugs Team
New task has been filed for this and fix will be included in In-Portal
5.0.3

553: Empty CategoryId in Item object after it's Created

http://tracker.in-portal.org/view.php?id=553


DA.

On Jan 25, 10:15 am, Dmitry Andrejev <dandre...@gmail.com> wrote:
> Hi Alex,
>
> Here is a patch for this. Let me know if it looks good.
>
> Cheers.
>
> DA.
>

> On Mon, Jan 25, 2010 at 9:48 AM, Alexander Obuhovich <aik.b...@gmail.com>wrote:
>
>
>
> > Topic (or category item) url leads to home page in TOPIC.ADD email event in
> > case, when topic creation confirmation template is not used. This happens
> > because just after topic (any other category item) is created it's
> > CategoryId virtual field is not filled with current category (where topic
> > was added to), but this CategoryId field is used later to build link to this
> > topic in TOPIC.ADD email event.
>
> > To fix this you should set CategoryId field to $category_id (when passed)
> > in kCatDBItem::assignPrimaryCategory() method (only when $category_id is not
> > empty).
> > Originally discovered by DmitryA.
>
> > --
> > Best Regards,
>
> >http://www.in-portal.com
> >http://www.alex-time.com
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "In-Portal Bugs Team" group.
> > To post to this group, send email to in-port...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > in-portal-bug...@googlegroups.com<in-portal-bugs%2Bunsubscribe@go oglegroups.com>


> > .
> > For more options, visit this group at
> >http://groups.google.com/group/in-portal-bugs?hl=en.
>
>
>

>  Empty_CategoryId_In_Item_Object_After_ Its_Created-Dmitry-20100126-v1.patch
> < 1KViewDownload

Alexander Obuhovich

unread,
Jan 26, 2010, 4:39:14 AM1/26/10
to in-port...@googlegroups.com
Seems good, but no additional if (!$this->GetDBField('CategoryId') && $primary_category) { is need, because $primary_category will have correct value in both cases (see ternary operator in method start).

To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/in-portal-bugs?hl=en.

Dmitry Andrejev

unread,
Jan 26, 2010, 10:25:52 AM1/26/10
to in-port...@googlegroups.com
Here is a new patch without IF around.

Please have a look.

DA.
Empty_CategoryId_In_Item_Object_After_ Its_Created-Dmitry-20100126-v2.patch

Alexander Obuhovich

unread,
Jan 26, 2010, 10:46:21 AM1/26/10
to in-port...@googlegroups.com
Seems ok, but trailing tab/space should be removed at $primary_category = ... line.

Dmitry Andrejev

unread,
Jan 26, 2010, 10:54:06 AM1/26/10
to in-port...@googlegroups.com
Thanks for noticing that! Final version attached. Cheers!
Empty_CategoryId_In_Item_Object_After_ Its_Created-Dmitry-20100126-v3.patch
Reply all
Reply to author
Forward
0 new messages