Mark, got this working great. Just wondering… will it be possible to implement this for usage on a top level categories page? i.e only display categories that contain entries with the custom field populated?
In my case it is
{exp:weblog:entries weblog="stockists_uk|stockists_europe|stockists_world" limit="9" stockist-paint="Yes"}
The stockist-paint being the custom field
This page is the categories page.
fingers tightly crossed
Trying to use this extension with the latest build (Build: 20070708) and can’t seem to make it work. I have this extension on the previous build prior to the 7th and it works fine.
Don’t think I’m doing anything wrong. Double checked weblog name, custom field name, added the two custom hooks in the mod.weblog file. Double checked all of that.
Just seems to be listing all 100 entries with no limit tag being used other than the custom field.
{exp:weblog:entries weblog="rep" zip="test" }
{title}
{/exp:weblog:entries}
I’ve tried it with and with out the parameters and all of them work on the previous build.
UPDATE: this extension does not seem to be working for me with the latest build. Can anyone confirm it is working for them?
I have just setup a new installation using 1.6.0 build 20070708 and I am also having the problem that this extension is no longer working. It was working OK in 1.5.2.
I enabled the comments in the extension and it is being called, but the SQL statement did not look to contain any references to my custom field. I therefore enabled SQL trace in the CP and compared the output from the old and new installations:
Here is an SQL statement from 1.5.2:
SELECT t.entry_id
FROM exp_weblog_titles AS t
LEFT JOIN exp_weblogs ON t.weblog_id = exp_weblogs.weblog_id
LEFT JOIN exp_members AS m ON m.member_id = t.author_id
INNER JOIN exp_weblog_data AS d ON t.entry_id=d.entry_id AND d.field_id_9 LIKE 'Re;commended Link%'
WHERE t.entry_id !=''
AND t.entry_date < 1184336493
AND (t.expiration_date = 0 || t.expiration_date > 1184336493)
AND exp_weblogs.is_user_blog = 'n'
AND t.weblog_id = '1'
AND t.status = 'open'
ORDER BY t.sticky desc, t.entry_date desc
LIMIT 0, 5
and here is the same query from 1.6.0:
SELECT t.entry_id
FROM exp_weblog_titles AS t
LEFT JOIN exp_weblogs ON t.weblog_id = exp_weblogs.weblog_id
LEFT JOIN exp_members AS m ON m.member_id = t.author_id
WHERE t.entry_id !=''
AND t.site_id IN ('1')
AND t.entry_date < 1184337003
AND (t.expiration_date = 0 || t.expiration_date > 1184337003)
AND exp_weblogs.is_user_blog = 'n'
AND t.weblog_id = '1'
AND t.status = 'open'
ORDER BY t.sticky desc, t.entry_date desc
LIMIT 0, 5
Comparing the output there are two relevant differences
The extra “AND t.site_id IN (‘1’)” which is expected based on the new functionality in EE 1.6.0.
The missing “INNER JOIN”:
INNER JOIN exp_weblog_data AS d ON t.entry_id=d.entry_id AND d.field_id_9 LIKE 'Recommended; Link%'
That SQL fragment is the code that the extension should be adding into the SQL, and it is missing in v1.6.0.
This explains why the results are different with v1.6.0, but it does not yet explain why the additional SQL is not being added. Maybe someone with more PHP experience can have a look at the code and see what might be going wrong?
I think this may be the issue…
In the build log for 20070705:
*Fixed a bug in Next / Prev Entry tags involving JOIN precedence changes in MySQL 5 that would cause a query error.
I believe changes were made to:
\system\modules\weblog\mod.weblog.php
Reverting to Build 20070627 allows this extension to work, but it breaks next/prev by category.
Perhaps somebody more capable than I could take a look at mod.weblog.php and see if we can once again have our cake and eat it too??
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.