Drupal 7 Views PHP (views_php) module error - drupal

Views PHP module give following error in site audit report:
Unfinished and incomplete, Views PHP permits executable code to be stored in the database with no revisioning; a typo introduced in the Views UI can bring down an entire production site with no accountability. See http://api.drupal.org/api/views for details on how to implement your own custom Views functionality.
How can I deal with this issue?

It can be a bug in some of installed modules. Are you maybe using something called "Pantheon"?
https://www.drupal.org/node/2420591
Anyway, try turning off some modules and see will error still appear.

Related

fun-hooks: referenced 'registerAdserver' but it was never created

I am using adinplay and their advertisement library in my site.
It is creating noise in my console. Can I fix this problem? If not what can I do about this log?
This is caused by prebid.js an open-source header bidding library. Prebid is built with multiple optional modules using gulp. This warning is thrown because one of the modules in your build of prebid.js includes a module referencing the hook, but the module that defines the hook is not. Nothing to worry

symfony debug:true does what?

I've been searching symfony docs and SO for an explanation of what changing symfony's debug flag to true does exactly. I feel stupid for not finding it ... can anyone provide a link to the doc?
Read Working with environments for more informations about the debug.
You are right, the Symfony Documentation related to the Debug component will help for use it but not give detailed explanations about the features added to the environment.
If you use debug=true in your environment, you will get the debug-bar containig all informations related to your environment, and other features related to debug in a PHP framework.
I will list the main additional features added by enabling debug :
Toolbar added with all informations about requests, security, deprecations, translations, configuration, and errors in your current request.
Cache files are dynamically rebuilt on each request.
Enable debugging features in packages and third-party libraries based on debug (such as Twig dump)
Errors displaying are no longer managed by the debug, it's just configured in the front-controller (e.g. app_dev.php and app.php)
Informations coming from Configuration and environments
Symfony documentation is very vast and it's surely not the bigger part, but very important to know, I discover it too.

liferay error on superclassing IFramePortlet

In the developing of liferay portlet, If I use IFramePortlet(com.liferay.portlet.iframe.IFramePortlet) in portlet-class tag in portlet xml
ERROR like this -
Registering portlets for gospel-for-asia-portlet
06:08:00,712
ERROR [localhost-startStop-6][PortletBagFactory:411] java.lang.ClassNotFoundException: com.liferay.portlet.iframe.IFramePortlet
(sometimes NoClassDefFoundError happens)
This error occurs on registering not building. I did add External Jars with portal-impl.jar for this.
That source is presented on github. I didn't change anything.
I am struggling with this problem for couple of days. Any clues would be welcomed.
Thank you.
You must not add portal-impl.jar to your custom portlets. This is the problem: IFramePortlet is part of portal-impl.jar, so it's part of Liferay's implementation. You don't have access to this class from a plugin. If you want it, you'll have to get the sourcecode and implement it yourself.
Adding portal-impl.jar will try to initialize all kind of portal infrastructure for a second time. Plus, you'll not want to depend on such a big library just for a tiny trivial portlet implementation.

wordpress 3.8.1 and wp-db-abstraction

I am trying to make a clean WP installation on Centos 5.8 platform using wp-db-abstraction plugin to interate with SQL Server 2008 R2 database.
I also updated PHP with version 5.4.27 where msssql module is enabled. Plus I fixed wp-db-abstraction plugin with those indications I found over Internet like fixing PATTERN variable and some stuffs like the correct path...
The matter is once I call wp-admin/install.php to install into database I get those messages on the page:
Strict Standards: Redefining already defined constructor for class Fields_map in
/var/www/html/wp-content/plugins/wp-db-abstraction/translations/sqlsrv/fields_map.php
on line 36
Strict Standards: Declaration of mssql_wpdb::prepare() should be compatible with
wpdb::prepare($query, $args) in /var/www/html/wp-content/plugins/wp-db-
abstraction/drivers/mssql.php on line 33
WordPress database error: [Incorrect syntax near 'wp_users'.]
SHOW TABLES LIKE 'wp_users'
If I complete installation ignoring messages, then WP wouldn't work well like miss some informations that couldn't write into database or something.
Any indication would be appreciate. Even if it exists a better and newer way to communicate with SQL Server database with latest WP versions. Thanks in advance to everyone!
Cheers,
Luigi
Done by myself... had just to add parameters into plugin's file.
Now I have to figure out the wordpress database error
[Incorrect syntax near 'wpmxp_users'.] SHOW TABLES LIKE 'wp_users'
only... Maybe is that error related to some syntax of new PHP version?...

What is the best way to debug production error templates?

I am trying to create pretty error pages for my application by following this cookbook article. Sometimes a bug slips in, which causes the application to return a single line: 503 Service Unavailable. It would make my life a whole lot easier if only I could see the underlying error or exception thrown. Switching over to the development environment doesn't help either as the error templates are only used in production.
I figured out that I needed to add TwigBundle to assetic's configuration to use javascript and css assets. Problems like this are really hard to debug in the production environment.
Setting the debug mode to true in my front controller doesn't help, since production error templates get replaced by development templates.
EDIT
Thanks to Mike Purcell I managed to retrieve the errors provided. I got
Uncaught exception 'Symfony\Component\Routing\Exception\ResourceNotFoundException' in /[snip]/app/cache/prod/appprodUrlMatcher.php:669
Turns out the framework should be handling the exception, but in the case of a possible error inside the error Twig template, it just decides to throw a 503 error.
How do I turn on error reporting for the production environment in a Symfony2 application?
I'm tired of guessing what's wrong and clearing the cache. What is the best way to debug Twig's error templates in production?
The best way to see what errors are being thrown in production is to configure Monolog to email the errors too you or alternatively to a file.
Have a look at the Symfony2 Cookbook on emailing logs http://symfony.com/doc/master/cookbook/logging/monolog_email.html
To make the error pages look nicer have a look at this cookbook entry on how to do that http://symfony.com/doc/master/cookbook/controller/error_pages.html
There are open source tools specifically built for error reporting like Sentry, which has a native Symfony client.
disclaimer: I work for Sentry

Resources