Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • VisiGod Friend
    #129641

    Two major bug fixes in JA Teline II

    Bug 1: SEF and JA News
    After over a month, when Joomlart made ANYTHING to solve their bugs in the SEF handling of JA Teline 2 (ja_news in particular), I finally found 3 hours to review what kind of bullshit (please excuse my slang) code is causing the issues. Of course the excuse that it is a bug in the Joomla! core was not satisfactory for me, as the built-in SEF works perfectly with any other templates/modules/plugins/components I used.

    While I have something like intermediate knowledge in PHP and MySQL (not a professional at all), I decided first to analyze the problem.

    So I implemented the ja_news with using the categories id-s and defined some colors assigned to these. But when I open the frontpage, everything is fine, except the links (the colorized one) to the categories. If your section name is “Section” (with ID 5) and your category name is “Category” (with ID 1), the link is expected to go on:
    http://www.site.com/section/category.html
    Unfortunately, it doesn’t works properly and instead goes to:
    http://www.site.com/section/category/1-category.html
    The URL is not the biggest issue here, but the problem is that it opens the ARTICLE with ID1, instead of a category view. The other issue is that it shows the article being under Category (ID1), while it could be under some other.
    It becomes even more annoying if due to some reasons you deleted Article with ID1 … than it goes to a very nice 404 error.

    So, how to understand, what is the problem? I first reviewed the source code of the generated page in order to view what the surrounding divs, which makes finding the nasty code after that easier.
    So I chose one of the categories and found the surrounding code:

    <div class="jazin-boxwrap jazin-theme-orange">
    <div class="jazin-box">
    <div class="jazin-section clearfix">
    <a href="/zibal/news/economics.html" title="Category Title.">
    <span>Category</span>
    </a>

    </div>

    Nice , now I should find where this code is exactly. The most obvious place to search was to search in modules/mod_janews/tmpl
    There are two files, when I couldn’t find it in the first one (blog.php) voala it appeared in blog_item.php

    There I saw how actually this incorrect link is generated (row 18):

    <a href="<?php echo $catlink;?>" title="<?php echo trim(strip_tags($catdesc));?>">

    Nice, so we have a variable $catlink that is incorrect. I correctly presumed that it is generated incorrectly somewhere within the same file. Bingo, rows 4-7:

    $catlink = JRoute::_(ContentHelperRoute::getCategoryRoute($rows[0]->catslug, $rows[0]->sectionid));
    }else{
    $catlink = JRoute::_(ContentHelperRoute::getSectionRoute($rows[0]->sectionid));
    }

    Well, it uses the standard JRoute and gets the data from the catslugs and sectionid. The second case is where ja_news uses sections and not categories, so I was obviously not interested in it.

    Well, if the address contains the ID of the Category and not the Section, it is very doubtful that the problem is caused by the “sectionid” call. It seems more like something incorrect in the query for the generation of the “catslugs”.

    If written in a good manner, this query should be in the module helper file. Thanks god, the ja_news uses properly (in terms of organization) the Joomla! 1.5 API structure. So the file was
    modules/mod_janews/helper.php

    I open it and through a simple search, I found two functions with DB queries where the catslugs were involved.
    One was named getHLNews and the other getList. I decided to try with getList, as the name sounds more reasonable as the place where this data is generated (although it was possible to be in the other as well).

    Now, we see on row 192:

    ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug,'.
    Pretty complex MySQL concatenation, but still not a big deal. I compare it to the standard Joomla! concatenation of Blog view (components/com_content/models/category.php), and didn’t found anything strange. Than I spent 1 beer time, to think what can cause the issue. The answer now probably seems very easy, but if you look at the whole SQL query, it doesn’t looks exactly in that way. The query on line 195:
    ' INNER JOIN #__categories AS cc ON cc.id = a.catid' .

    is going to make a join to the categories table and get the right id of my Category (ID1), then why do I need to get it in the slug as well?
    It is useless, but not only, getting the cc.id, when there is still no inner join to the #_categories table on cc.id=a.catid means that the query actually understands the category id as the article id.
    This works in a bit different way in the standard Joomla! category query (which I think was the base for JA to copy it), so it was just not needed. By simple change (deletion of the cc.id) of line 192 in helper.php from:

    ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug,'.

    to:

    ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":",cc.alias) ELSE cc.id END as catslug,'.

    fixes the SEF issues with the category links in ja_news.

    Now, the question is, what Joomlart offers? More than just a template? Sure, a template with bugs.
    As I am not planning for now to implement this template with other views, if there are any other issues related to SEF, feel free to post them here and I think the solution will come easier.

    Bug 2: JA Highslide in registration

    It just has scrolls everywhere in IE6. Looks ugly and only proves that none has tested that template from version 1.0 to 1.3 with IE6. As this is a pure HTML bug, I have no idea how it could be missed. I think, this is unprofessional.
    The fix:
    Open: templates/ja_teline_ii/html/mod_login/default.php and find on row 69:

    <a href="<?php echo JRoute::_("index.php?option=com_user&task=register");?>" onclick="return hs.htmlExpand(this, {contentId: 'id_highslide_signup_1',outlineType:'rounded-white',width:330,height:360,outlineWhileAnimating:true} )" >

    and change it to:

    <a href="<?php echo JRoute::_("index.php?option=com_user&task=register");?>" onclick="return hs.htmlExpand(this, {contentId: 'id_highslide_signup_1',outlineType:'rounded-white',width:350,height:390,outlineWhileAnimating:true} )" >

    Now, there should be no scrolls in the registration form in IE6.

    As I use this template in language different than English, where the texts for login and search are longer than in English, I had the same issue with the other two highslides (search form and login form). These can be found respectively in
    templates/ja_teline_ii/html/mod_search/default.php – Line 4, just edit the 230 width
    and
    templates/ja_teline_ii/html/mod_login/default.php – Line 10, just edit the 325 width

    Anyway, lets look at this in the constructive way:
    1. In my opinion JA should release 1.4 of the template with these fixes as I think a lot of people will download this template in future as well.
    2. In my opinion JA should PUT more efforts in testing, and not least in fixing their bugs. This one especially was reported few times.
    3. In my opinion, the extensions developed by JA to make their templates cooler, should be template independent, which will decrease significantly the number of the bugs in each release. There are other ways how to make an extension to look extremely cooler with a specific template (i.e. a css file related to that extension only). What do I mean:
    If we have the general extension ja_news (there is something like that now, but in each template it is built-in the code is different), there could be a simple check in it, if there is a file:
    templates/TEMPLATE IN USE/css/ja_news.css and if there is such file to load it and not the modules/mod_janews/ja_news.css
    So with the next template you release, you will just need to create at maximum:
    a) a new css file
    b) a html/mod_janews/tmpl/default.php file
    That way, you will decrease the risk of having wrong SQL queries or other programming staff and will focus on the presentation mainly … which is the core of your business right?

    At last, but not at least, JA please:
    1. Use the predefined languages strings that are available in the Joomla! core language files (i.e. do not use JText::_( ‘Login’ ), when there is a defined JText::_( ‘BUTTON_LOGIN’ ). I already saw some very bad practices in that direction.
    2. Always use JText – it costs not much, but saves time and nerves to your customers. I can give you examples in Teline II where this was not done due to laziness and nothing else, like “Close”, “Move”, “Text Size”.
    3. When there are instances of JText in your template, add these to the template language file. Don’t be lazy. Except the above mentioned in point 2, there are some other in Teline II like “REGISTER_REQUIRED”

    Thank you fore reading this.

    cgc0202 Friend
    #253425

    Hi VisiGod,

    Thanks for posting this. However, my suggestion is to subdivide them, so that only one error is presented per thread. That way, when others ask clarifications, only one issue is discussed.

    I will focus on an error that might be related to one of those you discussed (so please keep that here in this thread, and please place the other errors in separate threads)

    SEF error.

    I am afraid the long discussion about the nature of the error is beyond my grasp. However, I get an error only in the Joomla 1.5.x when I tried to check Yes for SEO Enabled in the Global Configuration (see changes shown below and error message).

    My question is:

    Does the script change you suggested in your post solve the Error indicated below?

    Thanks.

    Cornelio

    Search Engine Friendly Activation

    Route:
    ************************
    Administrator => Site => Global Configuration => SEO Settings =>

    Search Engine Friendly URLs No Yes
    ************************

    When I select Yes,

    And try the links, in the JA News, I got this error:

    ****************************************************************************
    JA News Error Message when SEF URLs is checked Yes
    ****************************************************************************
    404 – Component not found

    You may not be able to visit this page because of:

    1. an out-of-date bookmark/favourite
    2. a search engine that has an out-of-date listing for this site
    3. a mistyped address
    4. you have no access to this page
    5. The requested resource was not found.
    6. An error has occurred while processing your request.

    Please try one of the following pages:

    * Home Page

    If difficulties persist, please contact the System Administrator of this site.

    Component not found
    ************************

    [Note: the htaccess.txt was changed to => .htaccess already before the above action was taken]

    VisiGod Friend
    #253458

    It is very possible, in case you are using the “Categories” in ja_news and the category ID in example is 1 and you don’t have article with ID 1, then exactly this error appears.

    cgc0202 Friend
    #253462

    <em>@VisiGod 58935 wrote:</em><blockquote>It is very possible, in case you are using the “Categories” in ja_news and the category ID in example is 1 and you don’t have article with ID 1, then exactly this error appears.</blockquote>

    Thanks for responding VisiGod,

    OK, let me rephrase my question:

    Using the resulting Demo page from a Joomla 1.5x- JA Teline II:

    Did you get the errors I displayed if you activated (checked Yes) in the SEO Configuration?

    After you implemented the script you suggested, did the error disappear?

    Thanks.

    Cornelio

    bossep Friend
    #253470

    First of all THANK YOU both VisiGod and cgc0202 for your fantastic help to others.

    VisiGod, I totally agree with you on sloppy coding and the total lack of interest from JA to help us out. Perhaps they should PAY people like you not the other way around!
    I dont mind finding bugs in alfa and beta opensource stuff but when paying for it! Then it is a differnet ball game.
    This Template (Tline II) Is good! But JA is flushing it down the drain and as I belive this is the most popular one they might follow! Oh well time for bed and a handfull of asperin.

    Some thoughts:
    Isent it so that the front page uses classes forom jazin that is stored in the highlight module?
    So if I dont install the highlight module I dont get to use classes from that one on the front page?
    I should probably look that up but if this is the case, well do I have to say anything?

    Bosse

    instantinlaw Friend
    #253502

    Very good post visigod.
    Thanks for the info.

    VisiGod Friend
    #253546

    cgc0202 – Yes, I think so
    bossep – the css in the ja.news.css within the module folder. I think the name of the class (jazin) and the plugin are the same, but there is no connection between them.
    instantinlaw – Welcome 😉

    cgc0202 Friend
    #253557

    <em>@VisiGod 59044 wrote:</em><blockquote>cgc0202 – Yes, I think so
    bossep – the css in the ja.news.css within the module folder. I think the name of the class (jazin) and the plugin are the same, but there is no connection between them.
    instantinlaw – Welcome ;)</blockquote>

    Thanks VisiGod,

    I will surely try this once I use the Joomla 1.5x. Right now, I am focusing on the Joomla1.0x because many of the extensions I use are not native to Joomla 1.5x, yet.

    I hope I can convince you to take a closer look at the way the files and folders in the whole thing Joomla 1.5x-Teline II and whether these contributed to the sluggishness of the Joomla 1.5x install.

    Cornelio

    subfighter Friend
    #254308

    VisiGod

    thanks so much for the effort and time…as i just tested out the SEF and it did not work… Then i updated with your code above on my joomla 1.5.3 and it worked perfectly..

    this was definitely a major bug and needs to be updated by joomlart.com

    also applied then other fix you did also… dont have ie6 so i cant test it but i take your word..

    i will follow the other fixes you have posted.. i give you a THANK YOU where ever i can..

    VisiGod Friend
    #254323

    Welcome 😉

    cgc0202 Friend
    #254676

    Hi VisiGod,

    Can you please add the link to this post in the appropriate thread:

    for Joomla 1.5x
    Links to solved problems known bugs of Joomla 1.5x-JA Teline II
    http://www.joomlart.com/forums/topic/links-to-solved-problems-known-bugs-of-joomla-1-5x-ja-teline-ii/

    Since some threads could be very long, can you please provide the following:

    1. Original post heading:
    2. Link
    3. Your name (username)
    4. Summary:
    a. Brief description of the problem or question and desired goal
    b. Proposed solution to the problem that worked
    c. Please provide an image capture of the before and after, if possible.

    Without any Manual, How To’s or FAQ, the database of these solved problems may go a long way to help each other.

    Thanks,

    Cornelio

Viewing 11 posts - 1 through 11 (of 11 total)

This topic contains 11 replies, has 5 voices, and was last updated by  cgc0202 16 years, 5 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum