Support » Plugin: Cool Timeline » Story icons not displayed on icon selection window

  • Resolved gerardfigols

    (@gerardfigols)


    Hello Plugin developers,

    I discovered recently that the icons array is not well generated and this causes that the icon selection window doesn’t display any icon, only a search input.

    After revising the code, I found that in the function ctl_generate_icon_array, (/fa-icons/fa-icons-class.php), the icons were not being set because of a wrong logic: the class attribute is set only inside of the if statement. So, if ‘fa_icons’ options is already set, then this line: $this->icons = $icons; would never be executed.

    The solution is to place this variable assignment after and outside the if condition: if (! $icons). So the code would look like this:

    private function ctl_generate_icon_array() {
    	$icons = get_option ( 'fa_icons' );
    	if (! $icons) {
    		$all_icons = json_decode ( file_get_contents ( CT_FA_DIR . 'fontawesome-5.json' ), true );
    		foreach ( $all_icons as $icon ) {
    			$icons [] = array (
    				'class' => $icon
    			);
    		}
    		update_option ( 'fa_icons', $icons );
    	}
    	$this->icons = $icons;
    }

    It would be nice to have this working in the next plugin update. It doesn’t matter if this happens sooner or later. It is important that in the next update this fix is taken into account, so that the people who has solved it changing directly the source code, don’t lose this workaround (by source override).

    Thank you in advance and have a nice day.

    • This topic was modified 2 months, 2 weeks ago by gerardfigols.
    • This topic was modified 2 months, 2 weeks ago by gerardfigols.
    • This topic was modified 2 months, 2 weeks ago by gerardfigols.
    • This topic was modified 2 months, 2 weeks ago by gerardfigols.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author CoolHappy

    (@narinder-singh)

    Hi @gerardfigols,
    Thanks for spotting an issue. I included these changes and release version 1.9.1. Please update your old plugin version with the latest version.

    Hi @narinder-singh,

    Thanks for the implementation of the solution in the last update v. 1.9.1
    I did this update (1.9.1) and I can confirm that it works. Thank you!

    Best regards.

    • This reply was modified 1 month, 2 weeks ago by gerardfigols.
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.