Override Template does not work

Open to all! Ask other shopowners for help.
radhavallabh
Senior Contributor
Posts: 466
Joined: Tue Oct 27, 2020 4:09 am
Phoenix Version: 1.1.0.6
Has thanked: 29 times
Been thanked: 3 times

Re: Override Template does not work

Post by radhavallabh »

ecartz wrote: Sun Nov 20, 2022 6:14 am Go back and reapply the updates for 1.0.8.17 (from 1.0.8.16), 1.0.8.18, 1.0.8.19, and 1.0.8.20. In that order. You should not have to redo any of the SQL (if any), just the files. You are missing at least one change in those updates and possibly more than one.
Hi dear;
Repeated all changes no update missed so far;
I further tried debugging.
Only in Content modules this issue occurs-
Example
1. Install a content modules- testimonial modules-testimonial list = No menu appears after install.
2. I further go to headertag modules= Install and Uninstall a module.(Works normally)
3. Return to content modules-testimonial modules- testimonial list that I installed- full menu starts showing up now.
4. Remove the content-testimonial module- On install page shows the edit/remove buttons only in menu.
5. I further go to navbar modules= Install and Uninstall a module.(Works normally)
6. Return to content modules-testimonial modules- install section- testimonial list that I uninstalled menu starts showing up now with Install button.

I hope this helps you understand the exact issue I am facing.
Yet the override files are not being taken up by the store precisely the content modules only (cross checked again)

Pls your help shall be deeply appreciated,
Thank you in advance;
Warm Regds./
radhavallabh


Join The Code Co-op to get access to your library in the Code Co-op Forum
radhavallabh
Senior Contributor
Posts: 466
Joined: Tue Oct 27, 2020 4:09 am
Phoenix Version: 1.1.0.6
Has thanked: 29 times
Been thanked: 3 times

Re: Override Template does not work

Post by radhavallabh »

ecartz wrote: Sun Nov 20, 2022 6:14 am Go back and reapply the updates for 1.0.8.17 (from 1.0.8.16), 1.0.8.18, 1.0.8.19, and 1.0.8.20. In that order. You should not have to redo any of the SQL (if any), just the files. You are missing at least one change in those updates and possibly more than one.
Hi dear @ecartz
Same issue occurs on a fresh local host install of 1.0.8.20 in the Content module section as I highlighted yesterday.
Screenshot 2022-11-21 at 09-59-33 CE Phoenix Cart Administration Tool.png
Kindly please can you help fix this issue.
Very Warm Regds./
radhavallabh
You do not have the required permissions to view the files attached to this post.
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: Override Template does not work

Post by ecartz »

It looks like content modules only install/remove properly when a page is not selected.

I'll look into that more later. In the meantime, you should be able to work with it set to All modules, which is the same as it used to work.
radhavallabh
Senior Contributor
Posts: 466
Joined: Tue Oct 27, 2020 4:09 am
Phoenix Version: 1.1.0.6
Has thanked: 29 times
Been thanked: 3 times

Re: Override Template does not work

Post by radhavallabh »

ecartz wrote: Mon Nov 21, 2022 9:32 am It looks like content modules only install/remove properly when a page is not selected.

I'll look into that more later. In the meantime, you should be able to work with it set to All modules, which is the same as it used to work.
Ok dear;
One more thing I find a strange issue.
I downloaded a copy of my database file and worked with it on xampp using fresh copy of 1.0.8.20, pro-1.0.8.19 and my modified files one by one.
All have the override working properly in xampp. But they do not seem to work online on server.
Can you shed some light on what the issue might be;
Thank you in advance;
Very Warm Regds./
radhavallabh
radhavallabh
Senior Contributor
Posts: 466
Joined: Tue Oct 27, 2020 4:09 am
Phoenix Version: 1.1.0.6
Has thanked: 29 times
Been thanked: 3 times

Re: Override Template does not work

Post by radhavallabh »

ecartz wrote: Mon Nov 21, 2022 9:32 am It looks like content modules only install/remove properly when a page is not selected.

I'll look into that more later. In the meantime, you should be able to work with it set to All modules, which is the same as it used to work.
Hi dear @ecartz
Sorry for being persistent about my override template issue.
On further print_r debug check I notice that the hooks are being retrieved from the Override folder;
But further down it does not perform the _get_template_mapping_for function for other folders below when I write print_r for each return it excludes the override folder returning the original module links.

Code: Select all

 public static function _get_template_mapping_for($file, $type) {
      switch ($type) {
        case 'page':
          return DIR_FS_CATALOG . 'templates/override/includes/pages/' . basename($file);
        case 'component':
          return DIR_FS_CATALOG . 'templates/override/includes/components/' . basename($file);
		   
        case 'module':
          $file = static::extract_relative_path($file);
          $file = dirname($file) . '/tpl_' . basename($file);
		return DIR_FS_CATALOG . 'templates/override/$file';
				  
        case 'ext':
          $file = static::extract_relative_path($file);
          return DIR_FS_CATALOG . "templates/override/includes/$file";
        case 'translation':
        case 'literal':
        default:
          $file = static::extract_relative_path($file);
          return DIR_FS_CATALOG . "templates/override/$file";
      }
    }
Can you pls help me understand what may be going on??
Is it something related to static::extract_relative_path($file)

Thank you in advance.
Please your help shall be deeply appreciated;
Warm Regds./
radhavallabh
radhavallabh
Senior Contributor
Posts: 466
Joined: Tue Oct 27, 2020 4:09 am
Phoenix Version: 1.1.0.6
Has thanked: 29 times
Been thanked: 3 times

Re: Override Template does not work

Post by radhavallabh »

radhavallabh wrote: Wed Nov 23, 2022 7:49 am
ecartz wrote: Mon Nov 21, 2022 9:32 am It looks like content modules only install/remove properly when a page is not selected.

I'll look into that more later. In the meantime, you should be able to work with it set to All modules, which is the same as it used to work.
Hi dear @ecartz
Sorry for being persistent about my override template issue.
On further print_r debug check I notice that the hooks are being retrieved from the Override folder;
But further down it does not perform the _get_template_mapping_for function for other folders below when I write print_r for each return it excludes the override folder returning the original module links.

Code: Select all

 public static function _get_template_mapping_for($file, $type) {
      switch ($type) {
        case 'page':
          return DIR_FS_CATALOG . 'templates/override/includes/pages/' . basename($file);
        case 'component':
          return DIR_FS_CATALOG . 'templates/override/includes/components/' . basename($file);
		   
        case 'module':
          $file = static::extract_relative_path($file);
          $file = dirname($file) . '/tpl_' . basename($file);
		return DIR_FS_CATALOG . 'templates/override/$file';
				  
        case 'ext':
          $file = static::extract_relative_path($file);
          return DIR_FS_CATALOG . "templates/override/includes/$file";
        case 'translation':
        case 'literal':
        default:
          $file = static::extract_relative_path($file);
          return DIR_FS_CATALOG . "templates/override/$file";
      }
    }
Can you pls help me understand what may be going on??
Is it something related to static::extract_relative_path($file)

Thank you in advance.
Please your help shall be deeply appreciated;
Warm Regds./
radhavallabh
Hi dear @ecartz
I would also like to add that on further testing print_R returns all values from $type and $file .

But print_r gets nothing on the other return statements;

Please your help shall be ddeply appreciated;
Warm Regds./
radhavallabh
radhavallabh
Senior Contributor
Posts: 466
Joined: Tue Oct 27, 2020 4:09 am
Phoenix Version: 1.1.0.6
Has thanked: 29 times
Been thanked: 3 times

Re: Override Template does not work

Post by radhavallabh »

radhavallabh wrote: Wed Nov 23, 2022 10:00 am
radhavallabh wrote: Wed Nov 23, 2022 7:49 am
ecartz wrote: Mon Nov 21, 2022 9:32 am It looks like content modules only install/remove properly when a page is not selected.

I'll look into that more later. In the meantime, you should be able to work with it set to All modules, which is the same as it used to work.
Hi dear @ecartz
Sorry for being persistent about my override template issue.
On further print_r debug check I notice that the hooks are being retrieved from the Override folder;
But further down it does not perform the _get_template_mapping_for function for other folders below when I write print_r for each return it excludes the override folder returning the original module links.

Code: Select all

 public static function _get_template_mapping_for($file, $type) {
      switch ($type) {
        case 'page':
          return DIR_FS_CATALOG . 'templates/override/includes/pages/' . basename($file);
        case 'component':
          return DIR_FS_CATALOG . 'templates/override/includes/components/' . basename($file);
		   
        case 'module':
          $file = static::extract_relative_path($file);
          $file = dirname($file) . '/tpl_' . basename($file);
		return DIR_FS_CATALOG . 'templates/override/$file';
				  
        case 'ext':
          $file = static::extract_relative_path($file);
          return DIR_FS_CATALOG . "templates/override/includes/$file";
        case 'translation':
        case 'literal':
        default:
          $file = static::extract_relative_path($file);
          return DIR_FS_CATALOG . "templates/override/$file";
      }
    }
Can you pls help me understand what may be going on??
Is it something related to static::extract_relative_path($file)

Thank you in advance.
Please your help shall be deeply appreciated;
Warm Regds./
radhavallabh
Hi dear @ecartz
I would also like to add that on further testing print_R returns all values from $type and $file .

But print_r gets nothing on the other return statements;

Please your help shall be ddeply appreciated;
Warm Regds./
radhavallabh
Dear @ecartz Futher more now the core issue I find which is not working for me on server is this-

static::extract_relative_path($file)
Actually it is fetching as below complete home path when I print_r $file and not extracting the name without the DIR_FS_CATALOG as it should-
/xx/xx/xx/xx/xx/xx/catalog/includes/modules/content/testimonials/tpl_cm_t_list.php

I do not know why but this function below that means is not working on my server the way it should

Code: Select all

public static function extract_relative_path ( ......
Due to which the further return gets corrupted as the home path gets doubled.

Please can you help me?
Thank you in advance;
Regds./
radhavallabh
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: Override Template does not work

Post by ecartz »

radhavallabh wrote: Wed Nov 23, 2022 11:46 am static::extract_relative_path($file)
Actually it is fetching as below complete home path when I print_r $file and not extracting the name without the DIR_FS_CATALOG as it should-
That generally happens because your DIR_FS_CATALOG entry doesn't match what __FILE__ shows. Unfortunately, since you munged your path, I can't really help you more than to say to adjust DIR_FS_CATALOG to match what you were getting from $file. This would be in the part that you show as /xx/xx/xx/

Note that you want to compare $file and $base_path after line 37. Before that, the $file may not have been normalized.
radhavallabh
Senior Contributor
Posts: 466
Joined: Tue Oct 27, 2020 4:09 am
Phoenix Version: 1.1.0.6
Has thanked: 29 times
Been thanked: 3 times

Re: Override Template does not work

Post by radhavallabh »

ecartz wrote: Wed Nov 23, 2022 11:11 pm
radhavallabh wrote: Wed Nov 23, 2022 11:46 am static::extract_relative_path($file)
Actually it is fetching as below complete home path when I print_r $file and not extracting the name without the DIR_FS_CATALOG as it should-
That generally happens because your DIR_FS_CATALOG entry doesn't match what __FILE__ shows. Unfortunately, since you munged your path, I can't really help you more than to say to adjust DIR_FS_CATALOG to match what you were getting from $file. This would be in the part that you show as /xx/xx/xx/

Note that you want to compare $file and $base_path after line 37. Before that, the $file may not have been normalized.
Thank you so much dear!!
This helped me fix the issue finally :D

You are the best!!!
Very Warm Regds./
radhavallabh


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply