-
AuthorPosts
-
July 15, 2023 at 4:35 pm #1413362
I modify the code in enfold/framework/php/widgets/widget-classes/class-avia-combo.php to change the appearance of the Combo Widget.
I have just updated my test server to Enfold 5.6.4 from 5.5
The first edit I do is to the popular / recent / comments code block starting at line 176.
I add this code into the ‘popular’ section:
'cat' => '-1,-31,-73,-89,-708', 'meta_key' => 'wpb_post_views_count', 'orderby' => 'meta_value_num', 'date_query' => array( array( 'after' => '-1 week' ) )
after line 180, first adding a comma after
'order' => 'desc'
Now this happens when I edit the file in Dreamweaver.
I add the comma on line 180, hit enter for a new line to allow me to paste my code in, and get this error message in Dreamweaver:
“There is a syntax error on line 431. Code hinting may not work until you fix this error.”
I haven’t yet pasted my code in, all I did was add a new empty line – but as soon as I do, I get the error.If I delete the new line and comma, the error remains (but now stating on line 430 because I’ve removed the new line). If I do add the 4 lines of code at the new line, the error message changes to line 434.
I also add a line of code into the ‘recent’ code block after line 192. If I try to make this edit first instead of the ‘popular’ edit, the same error is reported from line 431 when I hit enter for a new line.
Line 430 is the function get_post_list – but I have not been anywhere near that code. I note that Gunter made changes to the function in 5.6 and 5.6.1
Any idea what the problem is to cause this error when I edit line 180? I’ve been modifying this file for years without problems.
July 16, 2023 at 8:43 pm #1413425Hey zimbo,
I have compared /class-avia-combo.php in v5.5 & v5.6.4 and don’t see anything that would prevet you from adding a comma after'order' => 'desc'
after popular / recent / comments code blocks and adding your code:
I don’t use Dreamweaver so I don’t know why it would show you an error, I use VS Code and don’t see any errors.Best regards,
MikeJuly 17, 2023 at 1:41 pm #1413496It’s not the comma that causes the error it’s when I hit enter to add a new, empty line. Or if I don’t do that but just paste in my amendment code, it’s the shifting down of all the code below.
The real question is, why is adding some code some 250 lines above causing the function get_post_list to throw an error?
July 17, 2023 at 2:15 pm #1413500Hi,
why is adding some code some 250 lines above causing the function get_post_list to throw an error?
Hard to say, what dreamweaver does, but the only idea I have that there is some misinterpreting of the character base causing a syntax error.
I user NetBeans https://netbeans.apache.org/ and do face any problems.
Try to switch to another editor and check, if the frontend works.Or try to ignore the error message and check frontend.
Best regards,
GünterJuly 18, 2023 at 7:01 pm #1413625I’ll try this out tomorrow in another editor and report.
July 19, 2023 at 4:30 pm #1413727I did the edits with Dreamweaver and uploaded class-avia-combo.php with the error showing, but everything worked fine on the test server, so I did the live site as well, without problems. I also edit class-avia-newsbox.php but that did not report any errors. I can only think as Gunter suggested that there is some character introduced from the recent edits that Dreamweaver has taken offence at because no errors were reported when I edited the 5.5 version back in March. Whatever, all seems OK.
July 20, 2023 at 11:33 am #1413827Hi,
Glad to hear that you have this sorted out with Günter’s help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘Problem editing class-avia-combo widget.php’ is closed to new replies.