Item Autocomplete return more than one results

Good Morning
When you go to add a spotligth in the search box by title return more than one results. In PublishedMonographDAO.inc.php in the file in the function _getByAssoc the query returns multiple results (not missing an groub by s.submissons)

Greetings and thank you

The group by is s.submission_id and the software is omp version 1.2

Thanks

Does anyone this problem? Is this a issue

Hi @Enrique_Manuel_Touce,

I’m having a little trouble duplicating this locally – one thing that would help is the exact query OMP is using.

If you have a developer toolbar (such as Firebug for Firefox), you can inspect each request the browser is sending to OMP. If you can open that and watch for the front end to send a request for autocomplete data to the back-end, then you can right-click on that request/response and open it in a new tab. This will allow you to use the Reload button to replay the request and view the results.

Then, temporarily turn on the “debug” option in config.inc.php and reload the request to see a response including all database queries that were involved. Look through the queries for the one near the end that corresponds to the autocomplete search.

Could you post that full query here?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alec

Thnks for your reply, the query is:

(mysql): SELECT	
				ps.*,
				s.*,
				COALESCE(f.seq, 10000) AS order_by,
				COALESCE(stl.setting_value, stpl.setting_value) AS series_title,
			COALESCE(sal.setting_value, sapl.setting_value) AS series_abbrev
			FROM	published_submissions ps
				JOIN submissions s ON ps.submission_id = s.submission_id
				LEFT JOIN series se ON se.series_id = s.series_id
			LEFT JOIN series_settings stpl ON (se.series_id = stpl.series_id AND stpl.setting_name = 'title' AND stpl.locale = 'es_ES')
			LEFT JOIN series_settings stl ON (se.series_id = stl.series_id AND stl.setting_name = 'title' AND stl.locale = 'es_ES')
			LEFT JOIN series_settings sapl ON (se.series_id = sapl.series_id AND sapl.setting_name = 'abbrev' AND sapl.locale = 'es_ES')
			LEFT JOIN series_settings sal ON (se.series_id = sal.series_id AND sal.setting_name = 'abbrev' AND sal.locale = 'es_ES')
				
				
					LEFT JOIN submission_settings st ON (st.submission_id = s.submission_id AND st.setting_name = 'title')
				
				
				LEFT JOIN features f ON (f.submission_id = s.submission_id AND f.assoc_type = 512 AND f.assoc_id = 1)
				LEFT JOIN new_releases nr ON (nr.submission_id = s.submission_id AND nr.assoc_type = 512 AND nr.assoc_id = 1)
			WHERE	ps.date_published IS NOT NULL AND s.context_id = 1
				
				
				
				
			ORDER BY order_by, st.setting_value ASC   

thnks

Hi @Enrique_Manuel_Touce,

I don’t think that’s the query that’s causing the problem; try to find the one that’s sent in response to an autocomplete request. (You should see your autocomplete text near the end of the query.)

Regards,
Alec Smecher
Public Knowledge Project Team