This the core of Novius OS, an Open Source CMS
See novius-os repository for more details.
Home Page: http://www.novius-os.org
This the core of Novius OS, an Open Source CMS
See novius-os repository for more details.
If an application is installed but its directory is not present in local/applications, errors occurs in the front part, even if this application is not used in the front.
Example: Module 'noviusos_appwizard' could not be found
Would it be possible to add a default preview to the enhancers? For example, it could use a title and an image provided by the config file.
This could save time to create simple enhancers.
Thanks
Jay
Fully deprecate get_context()
and is_main_context()
respectively on Nos\Orm_Behaviour_Contextable
and Nos\Orm_Behaviour_Twinnable
in a future major release.
Hello.
When you use the "addJavascriptInline" method, the core test if the string starts with '<script '. But, for example, twitter give us this code fore tweet button :
<script>!function(d,s,id)...
So the script node is not detected.
Does the "addJavascriptInline" method should not test if the string starts with '<script' instead of '<script ' ?
Thank you for your reply.
Hello !
I found that the "getContext" method do not work if you use it after the cache.
But if you use
\Nos\Nos::main_controller->getPage()->context
It works perfectly.
I don't know what is the better method to prevent this issue.
Fallback on the second method when you call the first after the cache or fill the "_context" properties of the front controller even after the cache.
Hello,
I wanted to add some styles in the wysiwygs of my project.
but my style are note displayed :
<?php
return array(
'setups' => array(
'default' => array(
'theme_advanced_style_formats' => array(
array(
'title' => 'Chapo',
'inline' => 'strong',
),
array(
'title' => 'Lien fleche',
'block' => 'p',
'classes' => 'bt-plus'
),
),
),
),
);
This configuration is merged to the native configuration (I see it in the renderer options) but it seems that it's not take in count by JS.
Did I do something wrong ?
Thanks in advance.
For a Twinnable HasMany relation you can configure the cascade_delete
by setting true
or false
.
With cascade_delete
set to false
there are 2 possible behaviours :
key_to
is not a common field on the target model, the item will be soft deleted (key_to
set to 0), the items in the others contexts won't be deleted.key_to
is a common field on the target model, the item and the items in the others contexts will be soft deleted (the key_to
is set to 0) .But with cascade_delete
set to true
there is only one behaviour :
key_to
is a common field or not, the item will be hard deleted (removed from database), and items in the others contexts won't be deleted.... instead it should be :
key_to
is not a common field on the target model, the item will be hard deleted (removed from database), the items in the others contexts won't be deleted.key_to
is a common field on the target model, the item and the items in the others contexts will be hard deleted (removed from database).To fix this issue we will have to write a custom save
method on Nos\Orm_Twinnable_HasMany
instead of using the save
method of the parent class Orm\HasMany
.
Here is the part of the save
method that hard deletes the related item :
$model_from->unfreeze();
$obj->delete();
$model_from->freeze();
It could be patched this way :
$model_from->unfreeze();
// Deletes the items in the other contexts if key_to is a common field
if (check_if_key_to_is_a_common_field()) { // @todo
foreach ($obj->find_other_contexts() as $other_obj) {
$other_obj->delete();
}
}
// Deletes the item in the current context
$obj->delete();
$model_from->freeze();
Will try to start a pull request when I'll have time.
In the meantime if you need to remove the items in all the contexts, use the soft delete (cascade_delete
set to false
).
Edit: updated patch code
Hello!
I've thought about something which might be helpfull to front developpers.
Up to now, using urlEnhancer and the url() method is only available with an existing item. It sometimes happens to deal with specific views thanks to an url enhancer without having a specific item.
eg : I have a list of items (default view directly on the page wich contains the url enhancer) or I can display a specific item of this list thanks to $object->url(...)
, but I may want to display a different kind of list (eg with a filter). The 3rd option should be available by doing something like
\Nos\Tools_Enhancer::url('enhancer_name', array(
...
'params' => array(
'some filter/page' => 'some value'
)
...
));
where the key "params" is used to call the get_url_model($item, $params)
method of the front controller, with $item = null
This would return an url like www.website.com/path/to/urlenhancer/requested_page.html
whereas now we can only have www.website.com/path/to/urlenhancer.html
.
Is this sounds acceptable? Or is there another way to do it?
Thanks in advance!
When using an Inspector with a custom query using a belongs-to relation the controller will create a query using wrong aliases resulting in a crash.
Config example:
return array(
'model' => 'Model_With_BelongsTo',
'query' => array(
'model' => 'Model_With_BelongsTo',
'related' => array('relation'),
'callback' => function ($query) {
return $query->where('relation.field', 1);
}
),
'input' => array(
'key' => 'id',
)
);
Will create something similar to
SELECT COUNT(DISTINCT `t0`.`id`) AS count_result,
`t1`.`id` AS `t1_c0`,`t1`.`other_fields_from_t0` AS `t1_c1`,
`t1`.`t1_real_fields` as `t1_c2`
FROM `table_0` AS `t0`
LEFT JOIN `table_2` AS `t1` ON (`t0`.`rel_id` = `t1`.`id`)
WHERE `t0`.`id` = 1
The where is executed on the wrong table and half the fields are selected on the wrong alias too.
Hello,
I think the commit 6706518 ("Bugfix for Tools_Url::page() returning path version of URL without .html") is responsible of one problem that doesn't appear before.
An example is more powerful than a long speach so :
in this page : http://oppoc.fr/blog.html , urls for the posts are not good. In the other page of the site, they are working properly (the url() method is call everywhere).
I hope you will find a solution for this problem.
Hello,
I found that enhancer previews are not displayed in the same way when you save it or when it is updated.
The difference is here :
novius-os/static/admin/vendor/tinymce/plugins/nosenhancer/editor_plugin_src.js
line 66 and line 218
In the first case (display is updated) the html of preview is send directly.
enhancer.html(json.preview);
In the second case, for security,the preview is put in a jQuery object before and the result of the "html" method is send like this :
.html($(json.preview).html());
But in that way, you just have the inner html of your preview.
For exemple if your preview is
<div>My div</div>
the result of :
$('<div>My div</div>').html();
is
My div
And that is what append in the line 218.
To prevent that, I suggest to do :
.html($(json.preview).get());
instead of
.html($(json.preview).html());
I suggest to to this also in line 66 to have the same behaviour in the two case.
Thanks in advance for your answer.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.