6.0.0-git
2018-12-16

[#14868] text_diff_renderer_inline calls itself, making subclassing impossible
Summary text_diff_renderer_inline calls itself, making subclassing impossible
Queue Horde Framework Packages
Type Bug
State Unconfirmed
Priority 1. Low
Owners
Requester mrten_horde (at) ii (dot) nl
Created 2018-10-23 (54 days ago)
Due
Updated 2018-10-23 (54 days ago)
Assigned
Resolved
Milestone
Patch Yes

History
2018-10-23 09:40:54 mrten_horde (at) ii (dot) nl Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Summary ⇒ text_diff_renderer_inline calls itself, making subclassing impossible
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ Yes
Reply to this comment
If you want to use another _encode function in a subclass of 
Horde_Text_Diff_Renderer_Inline you can subclass it. But on line ~160 
the class makes a new instantiation of itself, thereby nullifying the 
original subclass.

Small patch:

@@ -158,7 +158,8 @@
          }

          /* Get the diff in inline format. */
-        $renderer = new Horde_Text_Diff_Renderer_inline
+        $class = static::class;
+        $renderer = new $class

Saved Queries