Comments (18)
Don't have any idea yet. What version do you use?
Try to use this one: https://github.com/goFrendiAsgard/No-CMS/tree/80247c81b1eb42dfb7ae0420412d6c286cc8f812
I've check the error path (cms_model.php line 1071) and it seems to be okay.
Do you have any screenshot?
from no-cms.
I just cloned the repo from github and ran the installer.
The screen is just blank with the fatal error as I described above.
Will try with your link above
from no-cms.
Or you can do git fetch
Please tell me if there is still an error
from no-cms.
clean install, still the same problem. I am going to try and backtrace it as well.
from no-cms.
I think there is a problem with anonymous function in CodeIgniter's model. Or it might be related to MX_Controller
Not quite sure, because there is nothing wrong when I try it in my system (ubuntu, apache2, php 5.3)
from no-cms.
its almost like there is something being called statically, which is then trying to load the CMS_Model. MX has a lot of static methods, I will look there./
By the way, I can still access the default CI welcome controller.
from no-cms.
Hi, just to make sure if the problem is in (or not in) MX Controller,
I need your help to change line 9 of application/core/CMS_Controller.php
https://github.com/goFrendiAsgard/No-CMS/blob/master/application/core/CMS_Controller.php
From
class CMS_Controller extends MX_Controller {
into
class CMS_Controller extends CI_Controller {
from no-cms.
the issue seems to be that for whatever reason, CMS_Model is not receiving the CI instance when it is instantiated. It is probably something mis-configured on my side.
Changing from MX to CI on the controller made no difference
from no-cms.
I see. I'll try to figure it out too. Maybe I should use other system
from no-cms.
I commented out this line in CMS_Model (1071) -
return $this->cms_lang($arr[1]);
and it started working. I have not tested it fully to see what problems that might cause. Can you tell me what the intended behavior of the callback is?
from no-cms.
It will search for appropriate language in language setting.
So {{ language:Home }} Will be replaced with current language of "Home"
from no-cms.
I think the problem is variable scope. I believe that $this is not supported inside of an anonymous function until php 5.4.0.
I have changed the code to the following:
$_this = clone $this;
$replacement = function($arr) use ($_this) {
$_this->cms_lang($arr[1]);
};
Unless this creates some other downstream problem, I believe it will work properly.
from no-cms.
I see. I'll try this solution in some other anonymous function. Thanks for your hard work :)
from no-cms.
No problem. Let me know if there are any other issues you would like a second set of eyes to look at.
from no-cms.
I add a bit version checking here:
// php 5.4.0 or below doesn't support $this in anonymous function
if (strnatcmp(phpversion(),'5.4.0') >= 0){
$replacement = function($arr){
return $this->cms_lang($arr[1]);
};
}else{
$_this = clone $this;
$replacement = function($arr){
return $_this->cms_lang($arr[1]);
};
}
https://github.com/goFrendiAsgard/No-CMS/tree/faa80def868413ed02f0b79dcc38778a652d40ce
Thanks again for your hardwork
We owe you :)
from no-cms.
everything seemed fine, then I did a clean install with the updated code and it broke again.
I will work on it later today. It is like the clone stopped working all of a sudden.
it is kicking out the following.
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: _this
Filename: models/cms_model.php
Line Number: 1079
Fatal error: Call to a member function cms_lang() on a non-object in /path/to/No-CMS/application/models/cms_model.php on line 1079
from no-cms.
Fixed. Change your code to:
$replacement = function($arr) use ($_this) {
It makes $_this available to the function.
from no-cms.
Okay, and I think this is more general:
$replacement = function($arr) use ($this){
return $this->cms_lang($arr[1]);
};
EDIT : okay, what I write before is a bad idea, since $this can't be used in "use" part
And this one should fix everything :p
// php 5.4.0 or below doesn't support $this in anonymous function
if (strnatcmp(phpversion(),'5.4.0') >= 0){
$replacement = function($arr){
return $this->cms_lang($arr[1]);
};
}else{
$_this = clone $this;
$replacement = function($arr) use ($_this){
return $_this->cms_lang($arr[1]);
};
}
So I hope this gonna be work https://github.com/goFrendiAsgard/No-CMS/tree/92feec55e025e6774982b8c409e5f604f55be37f
Thank's again
from no-cms.
Related Issues (20)
- suggestion: bootstrap glyph as badge-icon HOT 1
- how to disable third party auth ? HOT 2
- library dropdown
- jquery fancybox HOT 2
- Problem with hosting HOT 1
- Error running NO-CMS on xampp installation HOT 2
- bad Merge from development to master HOT 1
- Translation: Form_submit HOT 2
- Internet Connectivity Setting HOT 2
- How to make admin panel different from frontend
- Slide Image Change in live server HOT 1
- Login not working HOT 3
- Issue on Apache 2.4 authz_mod HOT 1
- How can i use bootstrap version 4 to create my own theme. HOT 3
- Stored XSS in No-CMS HOT 1
- 2nd Stored XSS in No-CMS HOT 1
- XSS Persistent HOT 1
- Another Persistent XSS HOT 2
- sql injection HOT 1
- Dynamic Parameters in database.php
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from no-cms.