(solved) custom_css fail to load

jmoises

Active Member
Hello i move a site from diferent hosting, was working correctly but after i move the Custom_css.php file and template_css.php stop loading, here is the error i get in the console,

Latest Joomla & Fabrik
PHP Version 7.3.3

Code:
GET http://site/components/com_fabrik/views/details/tmpl/mytemplate/custom_css.php?c=3&rowid=3&view=details&rowid=3 net::ERR_ABORTED 500 (Internal Server Error)
index.php:18 

GET http://site/components/com_fabrik/views/details/tmpl/mytemplate/template_css.php?c=3&rowid=3&view=details&rowid=3 net::ERR_ABORTED 500 (Internal Server Error)

Thanks for any advise.
 
Last edited:
Probably something like a missing blank line at the end.

But without seeing the file, I can't really tell you. So maybe repost with the actual links, rather than '//site'.

-- hugh
 
you right here is the link

Code:
http://www.quinielasymomios.com.mx/index.php?option=com_fabrik&view=details&formid=3&rowid=1&Itemid=241
 
Or just copy and paste the content of one of the files here. Make sure you get the entire content, and embed it in code tags.

Also, make sure there is at least one blank line after the "EOT;" at the end of the file.

-- hugh
 
here is the default.php file

Code:
<?php
/**
* Bootstrap Details Template
*
* @package     Joomla
* @subpackage  Fabrik
* @copyright   Copyright (C) 2005-2016  Media A-Team, Inc. - All rights reserved.
* @license     GNU/GPL http://www.gnu.org/copyleft/gpl.html
* @since       3.1
*/

// No direct access
defined('_JEXEC') or die('Restricted access');

$form = $this->form;
$model = $this->getModel();

if ($this->params->get('show_page_heading', 1)) : ?>
    <div class="componentheading<?php echo $this->params->get('pageclass_sfx')?>">
        <?php echo $this->escape($this->params->get('page_heading')); ?>
    </div>
<?php
endif;

$group_name = $this->groups['Premios Disponibles'];
$elements = $group_name->elements;

//$myid = $elements['identificador']->value;
$titulo = $elements['titulo']->element_ro;
$imagen = $elements['imagen']->value;
$descripcion = $elements['descripcion']->element_ro;
$cantidadpuntos = $elements['cantidad_puntos']->element_ro;
$condiciones = $elements['condiciones']->element_ro;

if ($this->params->get('show-title', 1)) :?>
<div class="page-header">
    <h1><?php echo $titulo;?></h1>
</div>
<?php
endif;

echo $form->intro;
if ($this->isMambot) :
    echo '<div class="fabrikForm fabrikDetails fabrikIsMambot" id="' . $form->formid . '">';
else :
    echo '<div class="fabrikForm fabrikDetails" id="' . $form->formid . '">';
endif;
echo $this->plugintop;
echo $this->loadTemplate('buttons');
?>

<div id="elementos_principales">
    <div id="elemento_imagen"><img src="<?php echo $imagen;?>" alt="Quinielas y Momios" width="268" height="40" /></div>
    <div class="elementos"><?php echo $descripcion;?></div>
    <div class="elementos">Valor: <?php echo $cantidadpuntos;?></div>
    <div class="elementos"><?php echo $condiciones;?></div>
    <div class="elementos"><a href="javascript:history.back()">Regresar</a>    </div>
</div>

<?php


echo $this->pluginbottom;
echo $this->loadTemplate('actions');
echo '</div>';
echo $form->outro;
echo $this->pluginend;

Image of EOF
upload_2019-7-22_14-3-14.png
 
I still can't see any errors reported.

And I meant paste the content of one of the files that is failing (the custom css).

-- hugh
 
custom css file

Code:
<?php
/**
* Default Form Template: Custom CSS
*
* @package     Joomla
* @subpackage  Fabrik
* @copyright   Copyright (C) 2005-2016  Media A-Team, Inc. - All rights reserved.
* @license     GNU/GPL http://www.gnu.org/copyleft/gpl.html
* @since       3.0
*/

/**
* If you need to make small adjustments or additions to the CSS for a Fabrik
* template, you can create a custom_css.php file, which will be loaded after
* the main template_css.php for the template.
*
* This file will be invoked as a PHP file, so the view type and form ID
* can be used in order to narrow the scope of any style changes.  You do
* this by prepending #{$view}_$c to any selectors you use.  This will become
* (say) #form_12, or #details_11, which will be the HTML ID of your form
* on the page.
*
* See examples below, which you should remove if you copy this file.
*
* Don't edit anything outside of the BEGIN and END comments.
*
* For more on custom CSS, see the Wiki at:
*
* http://www.fabrikar.com/forums/index.php?wiki/form-and-details-templates/#the-custom-css-file
*
* NOTE - for backward compatibility with Fabrik 2.1, and in case you
* just prefer a simpler CSS file, without the added PHP parsing that
* allows you to be be more specific in your selectors, we will also include
* a custom.css we find in the same location as this file.
*
*/

header('Content-type: text/css');
$c = (int) $_REQUEST['c'];
$view = isset($_REQUEST['view']) ? $_REQUEST['view'] : 'form';
$rowid = isset($_REQUEST['rowid']) ? $_REQUEST['rowid'] : '';
$form = $view . '_' . $c;
if ($rowid !== '')
{
    $form .= '_' . $rowid;
}
echo <<<EOT

/* BEGIN - Your CSS styling starts here */

#$form .foobar {
    display: none;
}

#elemento_imagen {
    float: left!important;
}

.elementos {
    padding-top: 15px;
    font-size: 18px;
}

.blog-header .page-title, .blog-header h1, .page-header .page-title, .page-header h1 {
    font-size: 30px!important;
}


/* END - Your CSS styling ends here */

EOT;
 
Are you running something like AdminTools which is preventing access to php files as long as they are not explicitly allowed?
Or your new server is preventing such access?
Maybe you have to adapt a .htaccess file.
 
Are you running something like AdminTools which is preventing access to php files as long as they are not explicitly allowed?
Or your new server is preventing such access?
Maybe you have to adapt a .htaccess file.


i dont have at this moment Admintools, i just enabled .htaccess but same results. i will keep looking on the cpanel to see there is any other tool preventing the loading of the files.

Thanks for the reply
 
server logs

Code:
[Tue Jul 23 20:31:43.130116 2019] [:error] [pid 4030334:tid 140201137166080] [client 189.223.51.18:0] SoftException in Application.cpp:657: Directory "/home/quinikng/public_html/components" is writeable by group, referer: http://www.quinielasymomios.com.mx/index.php/premios-menu/lista-premios/details/3/3
[Tue Jul 23 20:31:43.130560 2019] [core:error] [pid 4030334:tid 140201137166080] [client 189.223.51.18:0] End of script output before headers: custom_css.php, referer: http://www.quinielasymomios.com.mx/index.php/premios-menu/lista-premios/details/3/3
[Tue Jul 23 20:31:43.133246 2019] [:error] [pid 4047089:tid 140201481266944] [client 189.223.51.18:0] SoftException in Application.cpp:657: Directory "/home/quinikng/public_html/components" is writeable by group, referer: http://www.quinielasymomios.com.mx/index.php/premios-menu/lista-premios/details/3/3
[Tue Jul 23 20:31:43.133340 2019] [core:error] [pid 4047089:tid 140201481266944] [client 189.223.51.18:0] End of script output before headers: template_css.php, referer: http://www.quinielasymomios.com.mx/index.php/premios-menu/lista-premios/details/3/3
 
The code you posted looks fine, no obvious errors, and PHP Storm doesn't show any issues.

Maybe try fixing that "writeable by group" thing. It's conceivable your server isn't allowing direct access to files if the folder is writeable.

-- hugh
 
Thank you, I have corrected the issue with the 500 error after changing the permission of the folder /home/site/public_html/components from 777 to 750.
 
Cool!

Just goes to show, read the error messages, and correct what you can, even if at first glance it doesn't seem related.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top