I have a few modules, but I will focus on one in particular. This module was working fine, and it appears in two articles. One article is viewable to registered users and the other article to the public.
I query my database from both of these articles. However, in the public article the module does what is supposed to, but in the registered article, it doesn’t.
Before posting code and examples, is there anything obvious that I’m missing that I can try to overcome this?
EDIT
Here are the results of debugging mode:
Working article:
SELECT name, specialty, location
FROM people
WHERE name = 'larry' OR specialty = 'testing' OR location = 'seattle'
Non-working article:
SELECT name, specialty, location
FROM people
WHERE name = '' OR specialty = '' OR location = ''
The same query should be at work in both cases, and is this:
SELECT name, specialty, location, description
FROM people
WHERE name = '$name' OR specialty = '$specialty' OR location = '$location'
where these variables are POST data, eg, $name = cleaned_up($_POST['name']);
So basically the “registered” users version of the form doesn’t post data to the query but the “guest” users version does.
EDIT 2
I discovered that when I remove the module on the left side of my page (I have two modules in divs, side by side, that share POST variables – which is probably part of my problem), the form that doesn’t work, starts to work properly.
So I built an identical module, thinking if I pulled that form out and gave the code to another module it would work, but it gave same results as above.
Any help is greatly appreciated.
EDIT 3
I threw a var_dump($_POST); in there in several locations, one at a time, and this gave the expected POST data. So now I’m really confused, because the SQL query is correct and the POST data are getting to the file that needs them.
I found a work around that seems to solve my problem. The original weird issue still exists, but this work around gets my site working and gives me something to go on.
I created as separate variable file for each access state, registered and public. Apparently in the registered state the variables were getting conflicted and the POST data wasn’t making it to the SQL query and thus wasn’t showing up in my results table.
I think it may be a bug in Joomla but I’d like to get someone else feedback before reporting it. BUT… I posted on forum.joomla.org weeks ago with not response so I have little faith in that support site at all. Actually, if this is as good as their support forums get, then I think I might look into another CMS.