[EXTENSION] phundament

Yup. And i even tried to update, as you said. But i got this error:




echo66@echo66-VirtualBox:/var/www/Phundament3$ php composer.phar update 

Welcome to Phundament Installation 3 via composer


Updating your application to the lastest available packages...

Loading composer repositories with package information

Updating dependencies

Your requirements could not be resolved to an installable set of packages.


  Problem 1

    - The requested package crisus83/yii-seo could not be found in any version, there may be a typo in the package name.

  Problem 2

    - Installation request for phundament/app 1.0.0 -> satisfiable by phundament/app 1.0.0.

    - Can only install one of: phundament/app 0.11.1, phundament/app 1.0.0.

    - Installation request for phundament/app 0.11.1 -> satisfiable by phundament/app 0.11.1.


Potential causes:

 - A typo in the package name

 - The package is not available in a stable-enough version according to your minimum-stability setting

   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.


Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.




I managed to solve the update problem, by removing, from composer.json, the entries listed in that error. Still, the problem with Metadata class continues…

This one is just a typo, I think.


crisus83/yii-seo => crisu83/yii-seo

And … the metadata class has short open tags :(

Could you try adding ‘php’ in the first line of vendor/phundament/p3admin/components/Metadata.php


<?php

/**

 * Metadata Helps to get metadata about models,controllers and actions in application*

 *

Please let me know, if that fixes the error.

Sorry but … not my code ;)

Thanks. :)

Well, now the error is

"Property "CWebUser.isSuperuser" is not defined."

It seems to be a problem in this function:




private function createReadAccessCriteria()

{

    $criteria = new CDbCriteria;

    // do not apply filter for superuser

    if (!Yii::app()->user->isSuperuser) {

        if ($this->owner->metaDataRelation != "_self_") {

            $criteria->with = $this->owner->metaDataRelation;

            $tablePrefix = $this->owner->metaDataRelation;

        } else {

            $tablePrefix = $this->owner->getTableAlias();



That field seems to be from Yii Rights extension. But, for some reason, the framework doesn’t include it???

I’m watching your tutorial, on youtube, to see if i forgot anything. :)

One of the things that i didn’t do was including the Phundament3 within an existing yii application. Let me try that, to see the results.

See ya later and thanks :)

EDIT: oh wait, that video was made during the period that Phundament3 didn’t include Yii. Hmmm…

I reinstalled the whole thing and problem solved! Probably, it was my fault, the issue of super user. Thanks, schmunk!!

Btw, is it supposed, in the Models tab (Backend frontpage), to have the following content???




array(3) { 'models' => array(1) { [0] => string(11) "ContactForm" } 'controllers' => array(1) { [2] => array(2) { 'name' => string(14) "SiteController" 'actions' => array(4) { ... } } } 'modules' => array(7) { [0] => array(3) { 'name' => string(3) "gii" 'controllers' => array(1) { ... } 'models' => array(1) { ... } } [1] => array(3) { 'name' => string(7) "p3admin" 'controllers' => array(1) { ... } 'models' => array(0) { ... } } [2] => array(3) { 'name' => string(9) "p3widgets" 'controllers' => array(4) { ... } 'models' => array(7) { ... } } [3] => array(3) { 'name' => string(7) "p3media" 'controllers' => array(6) { ... } 'models' => array(4) { ... } } [4] => array(3) { 'name' => string(7) "p3pages" 'controllers' => array(4) { ... } 'models' => array(6) { ... } } [5] => array(3) { 'name' => string(6) "rights" 'controllers' => array(3) { ... } 'models' => array(4) { ... } } [6] => array(3) { 'name' => string(4) "user" 'controllers' => array(10) { ... } 'models' => array(7) { ... } } } }




If you want to use rights, you have to configure your application user component like this: https://github.com/phundament/app/blob/master/config/main.php#L292

Or your add a method to your user class, which implements isSuperuser.

I’ll try to remove that dependency also, but I’ve no good idea at the moment.

You’re welcome!

About the video … sorry I am trying to create a new one for literally months now :angry:

About the backend page … it’s work in progress, feel free to improve it and send me a pull request ;)

ooooh ok ok.

I sound like a noob because, for ±1.5 years, i have been away from Yii framework. So, i forgot some things…

Btw, in order to have persistent widgets, in several pages, o i need to include, manually, in each one of those pages???

No, you can go to "Edit Widget Detail" (wrench-icon) and do i.e. to following setting:

container: top

module: _ALL

controller: _ALL

action name: _ALL

request param: _ALL

This widget would then appear on every page which has a container ‘top’

Another example:

container: sidebar

module:

controller: mycontroller

action name: _ALL

request param: _ALL

The widget would appear in any sidebar container in all actions of your MyController.

I was thinking about using this CMS in one of my projects but, because of the permissions management, i can’t use it, given the timeframe at hand. And, even worse, i need to refresh some ideas about Yii and take a look about the management of modules, as you have done. STILL, i really really really like what you have done, schmunk. :) Let’s hope that i can find some time to study this, even with my MsC schedule, at university.

Meanwhile, i will use Concrete5, because i’m in a hurry. :confused:

Hope to hear/read more from this project.

And thanks for the assistance!

:)

Thanks for your words :)

Just let me know if you’ve questions, feedback or ideas for improvement.

@ametad: I remember that you once had problem with yii-user and new profile fields, right? There was an error about the path aliases of yii user, as they are partially hardcoded in the module.

If you still have this issue, you can fix it by adding the following lines to config/main.php aliases


        // yii-user path fixes

        'application.modules.user.views.asset' => 'application.vendor.mishamx.yii-user.views.asset',

        'application.modules.user.components' => 'application.vendor.mishamx.yii-user.components',

Thanks for the update… I haven’t been here in months so my apologies for not replying!

I came here because there is a question on my mind about the working of p3Pages, in particular the process of how a page is being find and loaded.

These are some lines from the DefaultController actionPage():




	public function actionPage() {


		$model = null;

		$id = (isset($_GET[P3Page::PAGE_ID_KEY]) && is_numeric($_GET[P3Page::PAGE_ID_KEY])) ? $_GET[P3Page::PAGE_ID_KEY] : null;

		$name = isset($_GET[P3Page::PAGE_NAME_KEY]) ? $_GET[P3Page::PAGE_NAME_KEY] : null;


		if ($id) {

			$model = P3Page::model()->findByPk($id);

		} elseif ($name) {

			$model = P3Page::model()->findByAttributes(array('name' => $name));

... 



If there is no pageId set, the pageName will be used to try and find a P3Model bij the attribute ‘name’. But this attribute does not exist!

What I am looking for is clean URL, without the digit which is the pageId, the ‘id’ in the P3Page model. There is a seoUrl and I want to use that as reference to find the right P3Page… I am still looking how to do that with as much as existing code. Can you perhaps lead me in the right direction? What would be your approach?

Keep up the good work :)

PS. I dont use the yii-user module anymore because my user management needed a lot of highly customized functionality. So I decided to modify the original module and for now there is no need to go back to the source code…

Hi ametad,

you’re right, there’s outdated code in the model, sorry about that.

From p3pages 0.11.7 on there’s an optional attribute for P3Page models called “nameId”, which is meant to be used as a named identifier, but you can not translate it.

We could add an option to find a page by seoUrl, but I personally don’t like this approach because it’s too error-prone imo.

Eg. you’ve set up links in your HTML content an then someone changes the seoUrl, all links are broken. But with the id every link stays intact.

Another problem would be: if you use a text like seoUrl it has to be unique and you could not use the same string for two different languages.

Btw: I’ve discussed this issue with a really good SEO agency. They also wanted to remove it, but in the end they said it doesn’t really matter.

Looking forward to hear from you.

Best regards,

schmunk

applied some fixes for p3pages and nameId in 0.11.8

Hi Schmunk,

I have been busy with URL rule classes in Yii and perhaps there lies (some part of) an answer. But first I wanted to ask you, where is a good place to share these ideas? I mean, a place that is more suitable for programming code and stuff. And I am wondering if you are already using such an environment?

I am not yet familiar with a realy good one! IMHO: In Github you can only discuss code you wrote yourself and propose to someone else in a pull request (can be suitable but not for brainstorming new ideas). Realy the only things you can discuss are commits and not just existing code…

But perhaps you know and use already something?

Greetings!

I think it’s fine to use a specific commit with “Browse Code” and link directly to the stuff you wanna talk about, like so:

Just open an issue… cya!