I'm trying to add some sanity to the chaos that is Drupal by separating files in a fo-MVC structure. Within a Drupal view you can add Header or Footer code in textarea boxes with the option to add "PHP Code". Here is my code within the Header textarea box:
Fatal error: require_once() [function.require]:
Failed opening required '<path_to_root>/sites/all/modules/citysensei/controllers/staff_index.php'
(include_path='.:/Applications/MAMP/bin/php5/lib/php') in <path_to_root>/includes/common.inc(1355) :
eval()'d code on line 2
Is there a work around for this?
Thanks in advance,
Kris (quickly giving up on Drupal)
CODE:
require_once('<path_to_root>/sites/all/modules/citysensei/controllers/staff_index.php');
Not sure if it will solve your particular problem or not but Drupal encourages you to use their custom include function, like this in your case:
module_load_include('php', 'citysensei', 'controllers/staff_index');
This way a user can download your module and stick it whereever they like inside a modules directory and your code will still work.
Related
I'm making pages using drag and drop with wpbakery page builder in wordpress.
so I'm designing my blog page and when I want to try some grid elements this error shows up.
Warning: preg_match(): Compilation failed: invalid range in character class at offset 12 in C:\xampp\htdocs\website\wp-content\plugins\js_composer\include\classes\shortcodes\vc-basic-grid.php on line 184
the code it's warning is $content = $found[6][ $key ];
I will attach the whole file to this link so you can download and see this php file
now I'm working on localhost,my theme is Mediacenter and my page builder is Visual Composer v5.6 and wordpress is up to date.
I found out that it may cause by php version but maybe I can somehow edit my code.I just want to know where is wrong in code
I have to say I am unclear on the real reason for the error, but my only observation is that this .css file is being treated as a Lua file for whatever reason, which is why we see the error below.
Module:Citation/CS1/styles.css
http://www.gwart.co.uk/Module:Citation/CS1/styles.css
Other related errors: http://www.gwart.co.uk/Les_Edwards
How can I either fix this issue or alternatively, if needed, make this be a file rather than a module
Probably the page is being parsed as Lua because the content model is "Scribunto". If the TemplateStyles extension is installed, an admin can apparently change the content model of the page from "Scribunto" to "sanitized-css" and the page will be parsed correctly.
Another approach if you are not an admin is to create a .css subpage in the Template namespace and then move it to the Module namespace. Creating it in the Template namespace automatically gives it the "sanitized-css" content model, and it keeps its content model when it is moved to the Module namespace.
There is a Phabricator ticket requesting that Module subpages ending in .css automatically have the "sanitized-css" content model, but I do not know what progress has been made on implementing that.
I've put about 4 hours into trying to solve this issue. Please Help!
I've been working on developing my first custom plugin. Everything was going well until I started references files in subdirectories in my plugin. Here's the complete error I'm seeing every time I activate the plugin:
"The plugin generated 1521 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin."
My plugin file hierarchy is as follows:
Main File: wp-content/plugins/myplugin/index.php
Database Building File: wp-content/plugins/myplugins/DB/initialize.php
In my index.php file, I'm calling the initialize.php file using the register_activation_hook function.here's the whole code:
add_action('admin_menu', 'form_forge_options');
include_once dirname(__FILE__) . '/DB/initialize_database.php';
register_activation_hook(__FILE__ , 'bbp_g_init_database');
I've often found that the cause of this error is whitespace (or anything else) before the opening tag.
Use after the plugin(means at start) header ob_start();
i hope will help you:>
I've often found that the cause of this error is whitespace (or anything else) before the opening <?php tag or after the closing ?> tag. You can leave the closing tag off to avoid the latter issue.
However, after looking around on Google, it appears there are other possible reasons for this error message, and even a plugin that will help you debug this specific issue: Debug Plugin Activation Errors
i use display suite to style my taxonomy page and it suggests me some template files but i am not able to use that file, i put them in place but they do not include,
do you know how it will works please ? or any references ?!
this is my display suite screen
and i place file ds-reset--node-article-article-ds.tpl.php into address sites/all/modules/contrib/ds/layouts/ds_reset
but not thing gana happen
(would be a comment if I could :) You're supposed to put your template file in /sites/all/themes/your_theme/templates/, not in the DS folder.
Does anyone know where i can find the code that makes the user/permissions checkbox page in drupal? I'd like to see how it's done to make something similar for a custom module i'm building.
The function you're looking for is theme_checkbox($element) and can be found in root/includes/form.inc. If you ever want to know what function/template is responsible for a certain HTML element then Theme developer is your friend.
Enable the module, set the permissions and you'll see a small checkbox Themer info. Then just point to the HTML part you're interested and see what theme function/template is doing the rendering.
i think on default module folder there is user folder on user.admin.inc file contain code for permission function is user_admin_perm(); see this code