cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

Is that a new behavior to Phalcon\Tag::prependTitle or it is a bug?

Open borisdelev opened this issue 10 years ago • 5 comments

In Phalcon v2.x when i use tag:prependTitle the title is prepended

Phalcon\Tag::setTitle("PAGE");
Phalcon\Tag::prependTitle("test1");
Phalcon\Tag::prependTitle("test2");

// Title now is "test2 - test1 - PAGE" (depends of separator)

In Phalcon v3.x when i use tag:prependTitle the title replaced

Phalcon\Tag::setTitle("PAGE");
Phalcon\Tag::prependTitle("test1");
Phalcon\Tag::prependTitle("test2");

// Title now is "test2 - PAGE" (depends of separator)

So which behavior is right?

Sorry for my English. Thanks!

Details

  • Phalcon version: 3.x
  • PHP Version: 7
  • Operating System: Windows 10
  • Server: Apache

borisdelev avatar Sep 19 '16 14:09 borisdelev

Definitely a bug, title prepending or appending should stack (that's how it was).

@googlle updated a bunch of the title code without doing tests apparently. Need to revert/fix this asap.

virgofx avatar Sep 19 '16 14:09 virgofx

@butamuh4o Could you please add tests for expected behaviour? https://github.com/phalcon/cphalcon/blob/master/tests/unit/Tag/TagTitleTest.php

sergeyklay avatar Sep 19 '16 15:09 sergeyklay

Yep, sure. :) thanks

borisdelev avatar Sep 19 '16 15:09 borisdelev

Finally. I did it :) Good luck all, and thanks for your patience.

borisdelev avatar Sep 19 '16 20:09 borisdelev

Fixed in the 3.0.x branch.

sergeyklay avatar Sep 20 '16 08:09 sergeyklay