DrQuincy Posted June 7, 2023 Share Posted June 7, 2023 Hi, I just added ~140 items to a repeater using the API. The content seems fine and I can read it from the API but they look like this in the admin: The colour is different and after #99 it stops listing the number. Is this a performance thing? Is it likely going to cause any issues? It is a little slow to read but I have ProCache. Thanks. Link to comment Share on other sites More sharing options...
BitPoet Posted June 7, 2023 Share Posted June 7, 2023 It's not really going to cause issues, more of a visual misbehavior. Starting with version 3.0.190, repeater labels can contain a hexadecimal color value preceded by a hash sign, e.g. #ff0000. Short notation for CSS colors like #ff1 is also supported, so PW interprets item numbers with more than two digits as colors. My guts say this is unintended and could be easily fixed by reordering the code in InputfieldRepeater so the color substitution happens before replacing the counter placeholder, but the change was inititally targeted at the Repeater Matrix Pro fields which I don't have here. Probably best to file a github issue and let Ryan take a look. These are the lines in question: // update index numbers? if($hasCnt) { // replace "#n" with index number of repeater item $repeaterTitle = str_replace("#n", "#$cnt", $repeaterTitle); } if(strpos($repeaterTitle, '#') !== false) { $repeaterTitle = preg_replace('/#([a-f\d]{3,})/i', "$colorPrefix$1", $repeaterTitle); if(strpos($repeaterTitle, $colorPrefix) !== false) $hasColorPrefix = true; } 3 Link to comment Share on other sites More sharing options...
DrQuincy Posted June 7, 2023 Author Share Posted June 7, 2023 Thanks @BitPoet. You are right because if I change the repeater label to just {title} the colours revert to normal. I just found it jarring as I'm so used to the other green colour and wanted to make sure it wasn't something that would cause issues further down the line. I do not need the item number in this case. Link to comment Share on other sites More sharing options...
Smoky Posted June 7, 2023 Share Posted June 7, 2023 fyi: here is an issue https://github.com/processwire/processwire-issues/issues/1617 2 Link to comment Share on other sites More sharing options...
BitPoet Posted June 7, 2023 Share Posted June 7, 2023 7 hours ago, Smoky said: fyi: here is an issue https://github.com/processwire/processwire-issues/issues/1617 Thanks! I added my proposed solution to the issue. 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now