Forums / Upgrading to 1.5.x / Editing Breadcrumbs layout problem

Editing Breadcrumbs layout problem

Results 1 to 14 of 14
08 Jan 2019, 22:46
#1
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Posts:
2,015
Plugin Contributions:
0

Editing Breadcrumbs layout problem

zc156 or zc156a


Somehow breadcrumbs got fouled up and I tried to reset them to the default

If I copy/paste what is shown as "default"

 :: 

and click UPDATE

This
 :: 


is shown in the "value" column and

that is what is displayed.  :: 

IF I copy the breadcrumbs code from my current, live site
 <i class="fa fa-angle-right"></i> 


This is what appears
Home <i class="fa fa-angle-right"></i>  MyCategory


instead of something pretty.

zc156a install with demo data
drop tables
import 154 database
run zcinstall
install bootstrap template but after getting things looking nice found out is not ready for 156 with the debug files generated
change to classic responsive
08 Jan 2019, 23:41
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,907
Plugin Contributions:
1

Re: Editing Breadcrumbs layout problem

Result of the admin sanitizer. Thought I had seen something like that happen with other configuration menu entries, but forgot to put out some sort of bug report. At moment not sure which sanitizer in which to place the field, but will take a look unless someone else jumps in.
09 Jan 2019, 00:02
#3
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Posts:
2,015
Plugin Contributions:
0

Re: Editing Breadcrumbs layout problem

TNX for confirming is isnt some dumb mistake on my part.
09 Jan 2019, 00:21
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,907
Plugin Contributions:
1

Re: Editing Breadcrumbs layout problem

RixStix:

TNX for confirming is isnt some dumb mistake on my part.

So the sanitization is that the configuration_value is strictly sanitized which is like the complete encoding of anything you could think of, admin/includes/init_includes/init_sanitize.php refers.

Thing is, I'm not entirely sure what the thought was behind doing so, which makes it difficult to suggest anything that is not strict or some way on the store front to "undo" what was done... I recall seeing it have some effect to something else I was doing, but as I said I had moved on to the then main issue for me.

The other "difficulty" is determining which other sanitization would be suggested based on the possibility/likelihood of what could be included in setting a configuration value. I also haven't looked into the new configuration field to see what it's purpose is to perhaps see if it has any factor in this process.

Anyways, maybe moving it to the grouping including PRODUCT_NAME_DEEP_REGEX?

My thought behind that is that I thought that the product description regex would support scripts being in the content, which perhaps generally speaking may not be in the "standard" configuration value, and the words and symbols regex seems like it may clean too much out yet still... hopefully though some further guidance/correction of my recommendation will soon come. :/
09 Jan 2019, 01:16
#5
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Posts:
2,015
Plugin Contributions:
0

Re: Editing Breadcrumbs layout problem

so the sanitizer is sanitizing the recommended default setting?
09 Jan 2019, 01:26
#6
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,907
Plugin Contributions:
1

Re: Editing Breadcrumbs layout problem

RixStix:

so the sanitizer is sanitizing the recommended default setting?

When trying to store the recommended default setting, yes it then sanitizes that. Technically to get the "desired" result of the default, I think one would have to type in a space, two colons and then another space.

But then, if it were to be edited again, the same text would again have to be added...

Now, for some reason I thought I remembered something like this in ZC 1.5.5, but I can't recall and am away from my "tools".
09 Jan 2019, 01:58
#7
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Posts:
2,015
Plugin Contributions:
0

Re: Editing Breadcrumbs layout problem

If that is all that is needed, then I would suggest putting that in the default text so that it can be copied/pasted right above there in the field. sorta like what I did in the first effort to fix things, or not allow things to be edited if it requires knowledge not readily available to the average user.

The expectation was that copy/paste would work but I do understand catching every teeny glitch is next to impossible.

FYI: adding spaces has no effect other than add spaces into the breadcrumbs
09 Jan 2019, 02:12
#8
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Posts:
2,015
Plugin Contributions:
0

Re: Editing Breadcrumbs layout problem

BTW: preceeding space gets removed. trailing space stays. I misunderstood what you said. I thought you meant 'insert' a space instead of remove the code and just use a space.
09 Jan 2019, 20:30
#9
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,907
Plugin Contributions:
1

Re: Editing Breadcrumbs layout problem

RixStix:

BTW: preceeding space gets removed. trailing space stays. I misunderstood what you said. I thought you meant 'insert' a space instead of remove the code and just use a space.


No, you understood correctly. I just tried it myself and it appeared actually to remove both spaces. At least when I went back in to review the change.

After I posted that suggestion I also got to thinking about the "conversion" process, but typically
 
is presented/needed when there is an existing space before the character as multiple spaces in html are treated as a single space, but each
 
is treated as its own space.

So, the "work around" to this at the moment without modifying the sanitizer script is to execute the following sql in tools->Install SQL Patches:
UPDATE configuration SET configuration_value = ' :: ' WHERE configuration_key = 'BREAD_CRUMBS_SEPARATOR';

This would allow you to also use your "pretty" divider by substituting the applicable code for
' :: '
leaving/using the single quotes as applicable.

As said though, without modification of the sanitizer file admin/includes/init_includes/init_sanitize.php adding anything within the configuration options that includes characters such as: &, <, >, ', or " (those items encoded by the function htmlspecialchars) will get modified (double encoded essentially) and cause the display that you described above.
09 Jan 2019, 20:51
#10
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Posts:
2,015
Plugin Contributions:
0

Re: Editing Breadcrumbs layout problem

mc12345678:

No, you understood correctly. I just tried it myself and it appeared actually to remove both spaces. At least when I went back in to review the change.

After I posted that suggestion I also got to thinking about the "conversion" process, but typically
 
is presented/needed when there is an existing space before the character as multiple spaces in html are treated as a single space, but each
 
is treated as its own space.

So, the "work around" to this at the moment without modifying the sanitizer script is to execute the following sql in tools->Install SQL Patches:
UPDATE configuration SET configuration_value = ' :: ' WHERE configuration_key = 'BREAD_CRUMBS_SEPARATOR';

This would allow you to also use your "pretty" divider by substituting the applicable code for
' :: '
leaving/using the single quotes as applicable.

As said though, without modification of the sanitizer file admin/includes/init_includes/init_sanitize.php adding anything within the configuration options that includes characters such as: &, <, >, ', or " (those items encoded by the function htmlspecialchars) will get modified (double encoded essentially) and cause the display that you described above.

TNX MC12345678

I really avoid adding custom code or performing one-off commands as much as possible, so I will just live with the current default which prevents leading spaces. That's only a minor cosmetic issue which no one will know but me.
09 Jan 2019, 21:26
#11
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
6

Re: Editing Breadcrumbs layout problem

RixStix:

TNX MC12345678

I really avoid adding custom code or performing one-off commands as much as possible, so I will just live with the current default which prevents leading spaces. That's only a minor cosmetic issue which no one will know but me.


Rick,

(if using the ZCA Bootstrap Template)

When the bootstrap is uploaded and selected via Tools > Template Selection, a log is created. In that log:

the 2nd query is:
[PHP]UPDATE configuration SET configuration_value = '<li> / </li>', last_modified = now() WHERE configuration_key = 'BREAD_CRUMBS_SEPARATOR' LIMIT 1;[/PHP]

making this change and running the query is simple and the best solution

[PHP]UPDATE configuration SET configuration_value = '<li> <i class="fa fa-angle-right"></i> </li>', last_modified = now() WHERE configuration_key = 'BREAD_CRUMBS_SEPARATOR' LIMIT 1;[/PHP]

changing YOUR_ADMIN/includes/init_includes/init_zca_bootstrap_template_admin.php

line 237
[PHP]'BREAD_CRUMBS_SEPARATOR' => '<li> / </li>',[/PHP]

to
[PHP]'BREAD_CRUMBS_SEPARATOR' => '<li> <i class="fa fa-angle-right"></i> </li>',[/PHP]

will prepopulate that query in future logs so it can also be used with clones
09 Jan 2019, 22:23
#12
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Posts:
2,015
Plugin Contributions:
0

Re: Editing Breadcrumbs layout problem

rbarbour:

Rick,

(if using the ZCA Bootstrap Template)



TNX. I'll what happens after I delete the world and start over.
09 Jan 2019, 22:27
#13
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
6

Re: Editing Breadcrumbs layout problem

RixStix:

TNX. I'll what happens after I delete the world and start over.


make this change in your local file using a plain text editor before re-uploading. obviously it will remain in the db unless you plan to delete that as well.
09 Jan 2019, 22:30
#14
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Posts:
2,015
Plugin Contributions:
0

Re: Editing Breadcrumbs layout problem

TNX. Will do.

Yep, wiping the db before starting over.