All add-ons currently require PHP 7.4 or greater.

On July 4th 2024 PHP 8.2 will be the new minimum requirement for all add-ons. Expect any add-on released after that date to require 8.2 or greater. Some releases may not immediately take advantage of 8.x specific features in PHP, which means you might, be able to continue using new releases in PHP 7.4, however, if you experience an error the first thing you should do is update to PHP 8.2 then create a support ticket if the error persists.

Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Number of results not being returned correctly when Publisher Low Search extension is enabled.

Status Resolved
Add-on / Version Publisher Low Search 2.0.3
Severity
EE Version 2.11.1

TradeMark Media

Jul 06, 2016

Description:
We have search set up for a site that’s been working quite well for some time with Low Search, Publisher, and the Publisher Low Search extension. I’m using EE 2.11.1, Publisher 1.6.10 (with a fix added for when an entry is switched to a new channel), and Publisher Low Search 2.0.3. We’re having an issue that was just reported. When you run a search the number of results shown does not match up with the number of results the search says it returned.

For example, the {absolute_results} tag says there should be 50 results, but only 2 are shown on the page. I’ve been testing with a bare template with nothing but the search code on it. If I disabled the Low Search Publisher extension, then I get the correct number of results. If the Low Search Publisher extension is enabled, then I get the incorrect number of results.

Detailed steps to reproduce the issue:
1. Create a channel containing results and a Low Search Collection set up to search that channel.
2. Create a test template containing this code:

{exp:low_search:results
	query="{segment_2}"
	limit="100"
	collection="services"
	paginate="both"
	status="open"
	require_query="yes"
}
	{if count == 1}
		<p>
			<strong>{absolute_results} Results</strong>
		</p>
<p>	{/if}<br />
			<br /></p><p>{title}</p>
<p>	<br />
	{paginate}<br />
	    </p><p>Page {current_page} of {total_pages} pages {pagination_links}</p>
<p>	{/paginate}<br />
{/exp:low_search:results}

3. Visit the URL for the template you created using a keywords parameter in the URL that will give you some results.

4. The {absolute_results} tag will output the correct number of results, but the actual number of entries shown on the page should be much less. In my testing I have the absolute_results returning with “50” results but page only shows 2 entries.

#1

BoldMinded (Brian)

Stephen, what is your Persistent Entries setting set to?

#2

BoldMinded (Brian)

Also, are you searching in the default language or another language?

#3

Mighty Citizen

Persisten Entries is set to “Yes”.

#4

BoldMinded (Brian)

Can you provide a URL to where this is happening?

#5

Mighty Citizen

I have the same issue where I’m searching in the default language or another language.

#6

BoldMinded (Brian)

Comment has been marked private.

#7

BoldMinded (Brian)

I checked locally with the build in the previous comment and it seemed to work fine, with Persistent Entries on or off, and in the default and non-default language.

#8

Mighty Citizen

Comment has been marked private.

#9

Mighty Citizen

Comment has been marked private.

#10

BoldMinded (Brian)

Have you been able to replicate this in a clean environment? You have a lot going on with that page. I have a very similar template with pagination for testing (that works), just wondering if there is something else that is being overlooked?

#11

Mighty Citizen

Comment has been marked private.

#12

BoldMinded (Brian)

You’re searching on a custom field. What happens to those same results if you just search all the fields? E.g. https://www.navigatelifetexas.org/en/services-groups-events/test/?search=Milam

#13

Mighty Citizen

Comment has been marked private.

#14

Mighty Citizen

Hey Brian,

Alright..I’ve kept troubleshooting and think I’ve narrowed down the issue. There are a large number of entries that have the author_id of 59. It looks like the member account associated with the author_id of 59 was actually deleted and no longer exists. When the member with the author_id of 59 was deleted, the user who made that change chose to reassign their entries to the member with the author_id of 64. That change is reflected in the exp_channel_titles table, but the old author id of 59 is still showing up in the author_id column in the exp_publisher_titles channel. That must be why the search results only show up correctly if the Publisher Low Search extension is disabled - because the entries have a non-existent author_id in the Publisher table. If I re-save that entry the correct author_id shows up in the exp_publisher_titles channel and the entry then shows up fine in the search results.

We’ve actually removed a number of member accounts previously and chosen to re-assign those entries to a new member and I’ve just never noticed that those results have disappeared from the search. I just spot checked a few and there are a number of other author_ids that are showing up in the exp_publisher_titles channel that no longer match an existing member account. Those entries have the correct author_id in the exp_channel_titles table.

So it seems like Publisher isn’t correctly picking up the new author id when a member account is deleted and the user chooses to re-assign the entries that member had authored to a different member account.

#15

BoldMinded (Brian)

Thanks for this detailed report. My only response is “ugh” 😊

Not sure if there is a hook to use for the re-assignment of the member account, but I’ll look into it.

So it sounds like I can’t really fix the current issue, you’ll have to do it manually?

#16

Mighty Citizen

Yes, for now I’m just going to need to manually go through and figure out which member accounts were removed and what author_id those were re-assigned to and then update the exp_publisher_titles channel to match the author_id shown for the same entries in the exp_channel_titles.

I’d love to have a fix moving forward though - the way this section of the site is built is that certain members only have the ability to see their own entries. When someone new needs to take over managing those entries the old member account is deleted and the entries are transferred to the new member. So this will continue to be an issue in the future - definitely hoping there is a hook to use.

#17

Mighty Citizen

Hi Brian,

Just wanted to check in on this again to see if you had found any more information on a possible hook to use for the re-assignment of the member account. I took care of the current problem with a SQL query but would love to not have to run that often to catch any other entries that were moved.

Thanks again for your help.

#18

BoldMinded (Brian)

I haven’t sorry. To be honest I’ve been hesitant to do anything new in Publisher for EE2 while I focus on EE3. Pretty much all of my add-ons have been on feature freeze for a few months now. How often is this scenario occurring for you?

#19

Mighty Citizen

Comment has been marked private.

Login to reply