Skip to content

Commit

Permalink
Merge pull request #254 from rmdstudio/master
Browse files Browse the repository at this point in the history
bug fixes for version 4.1.4
  • Loading branch information
rmdstudio committed Jul 6, 2015
2 parents 7d165b4 + 845fa3e commit 20c5540
Show file tree
Hide file tree
Showing 21 changed files with 142 additions and 53 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
To view the detailed commits log go to https://github.com/anahitasocial/anahita/commits/master

Anahita 4.1.4 Birth Release
=============================
* fixed validation of whether an edge had the same node at both ends
* migration script to remove all the edges in the database which had the same node at both ends
* UI refinements
* migration script to change todos_todos table to InnoDB
* added an editable placeholder for the photos which had no title or description

Anahita 4.1.3 Birth Release
=============================
* major updates to the Subscriptions app. We are now using it ourselves.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Anahita

*Version:* 4.1.3 Birth Release
*Version:* 4.1.4 Birth Release

Anahita is a social networking framework and platform for building knowledge sharing apps and services. Use Anahita to launch:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
$session = null;
}
?>
<div>

<div class="entity-actions">
<form action="<?= @route( array( 'option' => 'com_connect', 'view' => 'setting', 'oid' => $actor->uniqueAlias, 'server' => $api->getName())) ?>" method="post">
<?php if ( !$session ) : ?>
<input type="hidden" name="get" value="accesstoken" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public function onBeforeControllerGet(KEvent $event)
$viewer = $this->getController()->viewer;
$actor = pick($this->getController()->actor, $viewer);
$layout = pick($this->getController()->getRequest()->layout, 'default');

$name = $this->getController()->getIdentifier()->name;

//create title
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ protected function _setGadgets($actor, $gadgets, $mode)
{
$gadgets->insert('photos', array(
'title' => JText::_('COM-PHOTOS-GADGET-DASHBOARD'),
'url' => 'option=com_photos&view=photos&filter=leaders&layout=gadget&oid='.$actor->uniqueAlias,
'url' => 'option=com_photos&view=photos&layout=gadget&filter=leaders',
'action' => JText::_('LIB-AN-GADGET-VIEW-ALL'),
'action_url' => 'option=com_photos&view=photos&filter=leaders&oid='.$actor->uniqueAlias,
'action_url' => 'option=com_photos&view=photos&filter=leaders',
));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@

<div class="entity-description-wrapper">
<h3 class="entity-title">
<?= @escape($photo->title) ?>
<?php if( $photo->title ): ?>
<?= @escape( $photo->title ) ?>
<?php else : ?>
<span class="muted"><?= @text('LIB-AN-EDITABLE-PLACEHOLDER') ?></span>
<?php endif; ?>
</h3>

<div class="entity-description">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@

<div class="entity-description-wrapper">
<h4 class="entity-title">
<a title="<?= @escape($photo->title) ?>" href="<?= @route($photo->getURL()) ?>">
<?= @escape($photo->title) ?>
</a>
<?php if( $photo->title ): ?>
<a title="<?= @escape($photo->title) ?>" href="<?= @route($photo->getURL()) ?>">
<?= @escape($photo->title) ?>
</a>
<?php else : ?>
<span class="muted"><?= @text('LIB-AN-EDITABLE-PLACEHOLDER') ?></span>
<?php endif; ?>
</h4>

<div class="entity-description">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@

<div class="entity-description-wrapper">
<h3 class="entity-title">
<?= @escape($photo->title) ?>
<?php if( $photo->title ): ?>
<?= @escape( $photo->title ) ?>
<?php else : ?>
<span class="muted"><?= @text('LIB-AN-EDITABLE-PLACEHOLDER') ?></span>
<?php endif; ?>
</h3>

<div class="entity-description">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

/**
* LICENSE: ##LICENSE##
*
* @package Com_Todos
* @subpackage Schema_Migration
*/

/**
* Schema Migration
*
* @package Com_Todos
* @subpackage Schema_Migration
*/
class ComTodosSchemaMigration4 extends ComMigratorMigrationVersion
{
/**
* Called when migrating up
*/
public function up()
{
dbexec('ALTER TABLE #__todos_todos ENGINE=InnoDB');
}

/**
* Called when rolling back a migration
*/
public function down()
{
//add your migration here
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ CREATE TABLE `#__todos_todos` (
`open_status_change_by` bigint(11) DEFAULT NULL,
PRIMARY KEY (`todos_todo_id`),
UNIQUE KEY `node_id` (`node_id`)
) ENGINE=MyISAM;
) ENGINE=InnoDB;

INSERT INTO #__migrator_versions (`version`,`component`) VALUES(1, 'todos') ON DUPLICATE KEY UPDATE `version` = 1;
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,11 @@ class ComTodosDomainEntityTodo extends ComMediumDomainEntityMedium
/*
* Priorities values
*/
const PRIORITY_HIGHEST = 2;
const PRIORITY_HIGH = 1;
const PRIORITY_NORMAL = 0;
const PRIORITY_LOW = -1;
const PRIORITY_LOWEST = -2;

/**
* Constructor.
*
* @param KConfig $config An optional KConfig object with configuration options.
*
* @return void
*/
public function __construct(KConfig $config)
{
parent::__construct($config);
}
const PRIORITY_HIGHEST = 2;
const PRIORITY_HIGH = 1;
const PRIORITY_NORMAL = 0;
const PRIORITY_LOW = -1;
const PRIORITY_LOWEST = -2;

/**
* Initializes the default configuration for the object
Expand All @@ -57,17 +45,17 @@ public function __construct(KConfig $config)
*
* @return void
*/
protected function _initialize(KConfig $config)
protected function _initialize( KConfig $config )
{
$config->append(array(
'resources' => array('todos_todos'),
'resources' => array( 'todos_todos' ),
'attributes' => array(
'name' => array('required'=>true),
'openStatusChangeTime' => array('column'=>'open_status_change_time','default'=>'date', 'type'=>'date', 'write'=>'private'),
'priority' => array('column'=>'ordering', 'default'=>self::PRIORITY_NORMAL, 'type'=>'integer')
'name' => array( 'required' => true ),
'openStatusChangeTime' => array( 'column'=>'open_status_change_time','default'=>'date', 'type'=>'date', 'write'=>'private'),
'priority' => array( 'column'=>'ordering', 'default'=>self::PRIORITY_NORMAL, 'type'=>'integer')
),
'relationships' => array(
'lastChanger' => array('parent'=>'com:people.domain.entity.person', 'child_column'=>'open_status_change_by'),
'lastChanger' => array( 'parent'=>'com:people.domain.entity.person', 'child_column'=>'open_status_change_by'),
),
'behaviors' => array(
'enableable'
Expand All @@ -77,29 +65,29 @@ protected function _initialize(KConfig $config)
)
));

parent::_initialize($config);
parent::_initialize( $config );
}

/**
* Opens the todo item
*
* @return null
*/
public function open($changer)
public function open( $changer )
{
$this->open = true;
$this->setLastChanger($changer);
$this->setLastChanger( $changer );
}

/**
* Closes the todo item
*
* @return null
*/
public function close($changer)
public function close( $changer )
{
$this->open = false;
$this->setLastChanger($changer);
$this->setLastChanger( $changer );
}

/**
Expand All @@ -111,7 +99,7 @@ public function close($changer)
*/
public function setLastChanger($changer)
{
$this->set('lastChanger', $changer);
$this->set('openStatusChangeTime', AnDomainAttribute::getInstance('date'));
$this->set( 'lastChanger', $changer );
$this->set( 'openStatusChangeTime', AnDomainAttribute::getInstance('date') );
}
}
33 changes: 33 additions & 0 deletions src/administrator/components/com_anahita/schemas/migrations/12.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

/**
* LICENSE: ##LICENSE##
*
* @package Com_Anahita
* @subpackage Schema_Migration
*/

/**
* Schema Migration
*
* @package Com_Anahita
* @subpackage Schema_Migration
*/
class ComAnahitaSchemaMigration12 extends ComMigratorMigrationVersion
{
/**
* Called when migrating up
*/
public function up()
{
dbexec("DELETE FROM #__anahita_edges WHERE node_a_id = node_b_id");
}

/**
* Called when rolling back a migration
*/
public function down()
{
//add your migration here
}
}
2 changes: 1 addition & 1 deletion src/libraries/anahita/anahita.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Anahita
*
* @var string
*/
static protected $_version = '4.1.3';
static protected $_version = '4.1.4';

/**
* Path to Anahita libraries
Expand Down
9 changes: 6 additions & 3 deletions src/libraries/default/base/domain/behavior/parentable.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ protected function _initialize(KConfig $config)
$relationship['polymorphic'] = $config->polymorphic;

//if parent is set, then set the base parent
if(isset($config['parent']))
if( isset( $config['parent'] ) )
{
if(strpos($config['parent'], '.') === false)
if( strpos( $config['parent'], '.' ) === false )
{
$identifier = clone $config->service_identifier;

$identifier->path = array('domain','entity');

$identifier->name = $config['parent'];
}
else
Expand All @@ -59,6 +61,7 @@ protected function _initialize(KConfig $config)
}

$relationship['parent'] = $identifier;

unset($config['parent']);

$config->append(array(
Expand All @@ -72,6 +75,6 @@ protected function _initialize(KConfig $config)
)
));

parent::_initialize($config);
parent::_initialize( $config );
}
}
7 changes: 3 additions & 4 deletions src/libraries/default/people/viewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public static function getInstance(KConfigInterface $config, KServiceInterface $
{
$viewer = $container->get('repos://site/people.person')->find(array('userId'=>$id));

if ( !$viewer ) {
if ( !$viewer )
{
$viewer = $container->get('com://site/people.helper.person')->createFromUser( JFactory::getUser() );
$viewer->save();
}
Expand All @@ -62,6 +63,4 @@ public static function getInstance(KConfigInterface $config, KServiceInterface $

return $container->get($config->service_identifier);
}
}

?>
}
4 changes: 3 additions & 1 deletion src/site/components/com_base/domains/entities/edge.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ protected function _initialize(KConfig $config)
//protected function _beforeEntityInsert(KCommandContext $context)
protected function _onEntityValidate(KCommandContext $context)
{
//@TODO temporary move it to a repository validators ??

if( $this->nodeA->id == $this->nodeB->id )
{
return false;
}

return true;
}
}
5 changes: 4 additions & 1 deletion src/site/language/en-GB/en-GB.lib_anahita.ini
Original file line number Diff line number Diff line change
Expand Up @@ -257,4 +257,7 @@ LIB-AN-SEARCH-PLACEHOLDER=Search ...
LIB-AN-SEARCH-PLACEHOLDER-OWNER=Search %s...
/* Remote */
LIB-AN-REMOTE-LOADING=Loading ...
LIB-AN-REMOTE-LOADING=Loading ...
/* Editable */
LIB-AN-EDITABLE-PLACEHOLDER=Click to edit
8 changes: 7 additions & 1 deletion src/site/templates/base/css/core/entity.less
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ h4.entity-name,
{
form
{
padding: 0 10px;
padding: 10px;
margin: 0;

.form-actions
{
margin: 0;
}
}
}

Expand Down
1 change: 1 addition & 0 deletions src/site/templates/base/css/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
//include bootstrap


// CSS Reset
@import "bootstrap/reset.less";

Expand Down
2 changes: 1 addition & 1 deletion src/site/templates/shiraz/css/style1/style.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions vendor/joomla/installation/sql/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ CREATE TABLE `#__anahita_nodes` (
`last_comment_on` datetime DEFAULT NULL,
`ordering` int(11) DEFAULT NULL,
`enabled` tinyint(1) DEFAULT NULL,
`pinned` tinyint(1) NOT NULL DEFAULT 0,
`is_default` tinyint(1) DEFAULT NULL,
`meta` text,
`hits` int(11) unsigned DEFAULT NULL,
Expand Down

0 comments on commit 20c5540

Please sign in to comment.