Zen Follower
- Join Date:
- Jul 2005
- Location:
- Charlottesville, VA
- Posts:
- 376
- Plugin Contributions:
- 0
template_func.php not working with custom product type
There is only a small change in the new includes/classes/template_func.php file in 1.3.5, but it seems to be breaking display of my custom product type, document_register, which is pretty much identical to document_product, I haven't done anything special with it (yet.)
The new template_func.php causes this error to appear in product display:
Warning: preg_match(): Unknown modifier 't' in /home/corek2/public_html/book135/includes/classes/template_func.php on line 60
Example: (but this will probably not show, I can't afford to leave it hanging around in live bookstore)
document_register product type info display example
Restoring the old template_func.php solves the problem.
There are only these differences in old/new:
lines 57-60 1.3.0 version:
if ($mydir = @dir($file_dir)) {
while ($file = $mydir->read()) {
if ( strstr($file, $file_pattern) ) {
lines 57-60 1.3.5 version:
$file_pattern = '/'.$file_pattern.'$/';
if ($mydir = @dir($file_dir)) {
while ($file = $mydir->read()) {
if (preg_match($file_pattern, $file)) {
preg_match function is found in includes/functions/functions_email.php and in admin/includes/functions/localization.php, and I think it is unchanged since version 1.3.0.
I don't know if this is a genuine bug, or if there's something wrong with my custom template, which has been working fine in all other respects.
I have not made any modifications to functions.
Apologies if this issue is not a bug after all!
---Diana