1
mrphilong
Songlist 1.14 - Weird bug
  • 2012/10/20 12:09

  • mrphilong

  • Quite a regular

  • Posts: 351

  • Since: 2006/7/14


If I set the Songlist module as the start page(http://www.caraok.net) on default when searching it returns the correctly result

1.
http://www.caraok.net/index.php?op=search&fct=title&value=&cid=0&gid=0&vcid=0&submit=Submit


If browse to the module(http://www.caraok.net/modules/songlist/) and search it returns an incorretly result

2.
http://www.caraok.net/modules/songlist/index.php?op=search&fct=title&value=&cid=0&gid=0&vcid=0&start=0


This could be a simple fix but I don't even know where to start.

2
irmtfan
Re: Songlist 1.14 - Weird bug
  • 2012/10/20 12:48

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


i cannot see any differences in searching from the start page and module page in your website.
But this module use some weird and non standard search functionality.
There should be an search.inc.php file and songlist_search function because it has these in xoops_version.php

// Search
$modversion['hasSearch'] = 1;
$modversion['search']['file'] = "include/search.inc.php";
$modversion['search']['func'] = "songlist_search";


This is a bug.
XOOPS CORE search.php cannot search this module because the above.
http://www.caraok.net/search.php


3
mrphilong
Re: Songlist 1.14 - Weird bug
  • 2012/10/20 14:19

  • mrphilong

  • Quite a regular

  • Posts: 351

  • Since: 2006/7/14


Songlist uses its own search and that's I would like. However, comparing the url when submitting a search on the start page and the module it is different.

4
irmtfan
Re: Songlist 1.14 - Weird bug
  • 2012/10/21 4:43

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


All xoops modules should define and use their own search function because Xoops Core has not any search functionality.
so "news", "newbb", "publisher" and all other modules defined their own functions.

as i said in the last post module developers should introduce their search function to Xoops Core by these lines in MODULE/xoops_version.php
// Search
$modversion['hasSearch'] = 1;
$modversion['search']['file'] = "include/search.inc.php";
$modversion['search']['func'] = "songlist_search";

And the above lines are exist in songlist/xoops_version.php but there is not any songlist/include/search.inc.php in Songlist module.
That is a bug.

Also the standard way is using MODULE/search.php file to create a search form/page and in Songlist it use a non standard way songlist/index.php?op=search

I still cannot understand your issue.
I cannot see any difference between the search results in start xoops page and module page.

you mean there is "submit=Submit" in the start page URL but a "start=0" in the module page URL?

If you mean the above you should explained it better.
it is not important and it is because songlist module use a global start variable (it is bad coding) that is defined in its header songlist/header.php and because it is not readed by Xoops Core in the start xoops page you dont have any start.
All variables for the search page ( here songlist/index.php ) should be defined in that page only.

5
mrphilong
Re: Songlist 1.14 - Weird bug
  • 2012/10/21 11:07

  • mrphilong

  • Quite a regular

  • Posts: 351

  • Since: 2006/7/14


Quote:

I cannot see any difference between the search results in start xoops page and module page.


Try testing the module as per below:

1. Go to www.caraok.net (currently Songlist has been set as start page module)
Select a Genre Asia and click the Search button.
take note of the URL and Genre is still Asia.

2. click Songlist from the Main Menu
Select a Genre Asia and click the Search button.
take note of the URL and Genre, URL is different and Genre has return to ALL instead of Asia.

Quote:
And the above lines are exist in songlist/xoops_version.php but there is not any songlist/include/search.inc.php in Songlist module.
That is a bug.


I know full of BUGS... !

Quote:
songlist module use a global start variable (it is bad coding)


I am not a coder, can't comment on this. From testing it, I know it is FULL of BUGS.


Thankyou for your time in looking into the module, much appreciated. Wish someone could develop the module futher.

6
irmtfan
Re: Songlist 1.14 - Weird bug
  • 2012/10/22 4:58

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


I can see no error in Genre.
The "Asia" is in the Company select box and it has problem.

when you click on submit the URL bar in the browser says:
..modules/songlist/index.php?op=search&fct=title&value=&cid=2&gid=0&vcid=0&start=0

but 'cid' is not in $_REQUEST?
The above is a very bad coding and it is a challenging bug because when you redirect to the url without cid in the URL, there is no cid in the url and it overwrite the session. it is the issue. You are visiting the page for the second time without cid and the code doesn't say don't do this if cid doesn't exist.

I take a look at songlist codes and unfortunately the developer of this module is very very careless about a clean and understandable coding and even dont take care about error reports and dont take a look at them.
It seems developer just write codes without thinking. And you will be wrong without thinking even if you be a GOD in php and mysql.

Anyway i dont have any good solution for the above issue because i need to rewrite this module but if i was a developer and want to decide between debugging this module and writing a new one i defiantly choose writing a new module.

to solve the above issue temporary open songlist/header.php and in top of the file just before mainfile.php included add these:
if ( isset($_REQUEST['cid']) ) {
  
$_SESSION['cid'] = $_REQUEST['cid'];
}


7
mrphilong
Re: Songlist 1.14 - Weird bug
  • 2012/10/22 13:39

  • mrphilong

  • Quite a regular

  • Posts: 351

  • Since: 2006/7/14


irmtfan,

You have made my day, thankyou! I wish ALL serious(code for living) developer should read this thread! Others do read your CODE...how much work you get in the future really depend on your current work.


8
irmtfan
Re: Songlist 1.14 - Weird bug
  • 2012/10/24 2:59

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


I tested some xoops modules that created in the last 3 years and investigated their codes.
Publisher is one of the best and professional recent modules.
I hope core team do not create a new content module and use/debug publisher.

Login

Who's Online

249 user(s) are online (138 user(s) are browsing Support Forums)


Members: 0


Guests: 249


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits