movabletype / movabletype Goto Github PK
View Code? Open in Web Editor NEWMovable Type
Home Page: http://www.movabletype.org/
Movable Type
Home Page: http://www.movabletype.org/
movabletype/lib/MT/App/DataAPI.pm
Line 2970 in 8989bb7
I'm using Varnish as a reverse-proxy and would like to cache API responses, but can't because of this Cache-Control: no-cache
setting. Is there a reason why the DataAPI is forcing no cache?
Should I do a PR so that this is controlled by an app config like $app->config->HeaderCacheControl
or get rid of completely?
Every time I try to run the CGI to install the site it just loads up the file but never runs it, I have tried to install it four different times.
not sure if this is on Ubuntu's side or not. some help would be nice
Hello,
I am currently trying to have different edit_entry.tmpl pages in the dashboard and I'm trying to put the logic into a large file:
edit_entry.tmpl:
<mt:if name="blog_id" eq="4">
## original content of edit_entry.tmpl
<mt:elseif name="blog_id" eq="20">
## original content of edit_entry.tmpl
</mt:if>
For testing purposes I have put the original content of edit_entry.tmpl into both cases (since apparently mt:include loses the current scope) and I have noticed that when you create a new entry, entries for the blog_id listed first in the if (4 in the case above), wont save. New entries for the blog with the id 20 will save normally.
Nothing particular happens besides that. It will show the "saved successfully" message, but all the custom fields are empty.
According to this page, there's a build_file callback:
https://github.com/movabletype/movabletype/blob/f02afa4e1ed554ebc3c265d3856fb09e1666eb00/lib/MT/Callback.pod
When writing an MT plugin that is triggered by that callback, how should the callback be used? For example, this in my config.yaml
doesn't seem to work:
callbacks:
build_file: $MyPlugin::MyPlugin::method_to_call_after_build_file
Is this a bug? When I create an entry and publish it, it doesn't seem to call my plugin. Same for updated and editing an existing entry.
I am trying to add dynamic parameters to control template inside cms:
<mtapp:setting
id="<mt:var name="name" escape="html">"
label_class="top-label"
label="<mt:var name="label" escape="html">"
hint="<mt:var name="hint" escape="html">"
show_hint="<mt:var name="show_hint_custom" escape="html">">
<input id="name" type="text" name="<mt:var name="name" escape="html">" value=" <mt:var name="value" escape="html">" />
</mtapp:setting>
variable show_hint_custom is passed to a template with a correct state ( 1 or 0 )
app:setting is setting always 1 for variable even variable has 0
the same thing is happening to required attribute.
is it bug? or there is workaround?
I upgraded to 6.3.6 and now every time I login, I have to reset password. I've even set the password using mySQL:
update mt_author set author_password = encrypt('YOURPASSWORD') where author_id = 1;
and it still doesn't work.
Sites and Entries under the menu won't show any items when CGIPath and StaticWebPath domain names are different in mt7.
After I moved CGI into the site, the items are shown. This has allowed me to see the list temporarily.
CGIPath domain name : mt7.youre.space
StaticWebPath domain name : newlog.youre.space
It looks all plugins that have extnesion to a author object failes with error durning an upgrade:
Can't call method "password" on an undefined value at lib/MT/App/Upgrader.pm line 122.
plugins with:
config.yaml
object_types: author: extended_field: string(255)
this is seen with latest version like cannot extend table... but it read plugins data as data already exist.
I ran across an issue with the MariaDB/MySQL backend.
The old style VARCHAR(255)
breaks the database spec if the utf8mb4
charset is used.
utf8mb4
supports the full uft8 range with character sizes up to 4 bytes.
If the default charset of a database is set to utf8mb4
, then the database specification of MT breaks because the maximun size for index columns is 1000 bytes. However, if VARCHAR(255)
is specified with utf8mb4
the maximum size of that field would be 1020.
This is a problem if emojis are used, for example in titles, author names, and other user editable meta data. Unfortunately, users love using emojis pretty much everywhere ;)
There are two approaches to fix this:
Reduce the field size to 250 and trim existing data if necessary (would not be a problem here).
Have user editable fields with the 255 length in utf8bm4 and downsize them into 255 2-byte utf8 strings for the corresponding index fields. (not sure if that makes sense).
using with log4perl 1.53 (put in extlib)
warning Wide character in print in
run-periodic-tasks
Wide character in print at /(snip)/mt/extlib/Log/Log4perl/Appender/File.pm line 313.
There's some sort of conflicting condition that occurs when creating a page through the API. For example, say we have a folder with ID 1 with a path a/b/ and we want to create "index.html" in this folder through the API. The following patterns will produce different results:
folder | basename | resulting folder | resulting permalink | expected result |
---|---|---|---|---|
a/b | index | a/b | a/b/post-0.html | a/b/index.html |
a/b | a/b | a/b/post-0.html | a/b/post-0.html | |
index | index.html | index.html | ||
a/b | a/b/index | a/b | a/b/a/b/index.html | a/b/index.html |
a/b/index | a/b/index.html | a/b/index.html |
Ideally the first pattern should work, but it does not. The only pattern that works is if you do not set the folder and set the base name as the full path without the .html extension, but then you can't sort the file into a folder in the admin screen.
NOTE
I'm putting almost 3000 pages into a fresh instance (with a license!), so not using the API is not an option, and the site is going to be intensely difficult to manage without folders.
This is for MT version: Movable Type version: r.4208 (7.0.1)
When I create a new user through the v3 API with the correct systemPermissions: ['sign_in_cms']
, the user is correctly created, but the user still can't log into the CMS because they get an "invalid login" error. I can bypass this by going through the admin panel and re-saving the user OR manually updating the db table so that the mt_author.author_auth_type = MT
, but this seems like a bug.
Steps to reproduce:
sign_in_cms
update mt_author set author_auth_type='MT' where author_name='author_name_i_just-created';
Folders stopped loading reliably after a point (we have almost 300 folders/sub folders). I think it's some sort of timeout issue while building the collection, but there are JS load errors as well. This only started occurring as we added more folders. I'm not seeing anything in any of my logs, and the DB connections aren't timing out or anything, so I actually don't have any information other than what I'm getting in the browser. Screen shot for reference:
If there's some extra information I can provide please tell me what and how to get it.
I've confirmed this is occurring in 6.3.6 and as a test tried a 6.2 release - both have the same issue.
version r.4208 (7.0.1)
Doing the same GET request to /mt/mt-data-api.cgi/v3/sites/1/entries?fields=author,basename
will return different responses even if no entries were added or deleted.
Steps to reproduce:
/mt/mt-data-api.cgi/v3/sites/1/entries?fields=author,basename
, take note of the response.I don't think it's a memcached error because I have disabled memcached and this still keeps happening.
If the database contains UTF8 strings and has the correct format, the respective strings will in the wrong encoding in the UI and on the published pages.
Most URL templates allow only relative (to the current page) or absolute (protocol, host etc.) links.
It would be nicer if template designers have more control over the generated URLs without touching the odd translate functions.
Instead, it would be nice to allow protocol-relative and host-relative paths in all URLs passed to the templates.
protocol-relative URLs make it easy to run http and https version of the same site without modification of the rendered HTML. Instead of publishing links as http://example.com/xx/yyyy/index.html
, the link would be just //example.com/xx/yyyy/index.html
. When switching protocols, the entire site remains functional without the need of maintaining the a separate site.
host-relative URLs start with omit the host part of the URL and start with the site root. This is extremely helpful if running the same site under the different URLs (e.g., www.example.com
and example.com
). Host-relative URLs would transform http://example.com/xx/yyyy/index.html
into /xx/yyyy/index.html
. This makes stylesheets and javascript links much nicer and shorter.
This is part of separating the features of #710
Every time I use the search function or tag search error is shown. The search results are OK.
An example below:
2020/05/15 17:37:56 [error] 861#861: *126285 FastCGI sent in stderr: "2020-05-15T17:37:56 [INFO] --- Start search process. at lib/MT/App.pm line 3291.
2020-05-15T17:37:56 [INFO] Start search_terms. at lib/MT/App.pm line 3291.
2020-05-15T17:37:56 [INFO] End search_terms. at lib/MT/App.pm line 3291.
2020-05-15T17:37:56 [INFO] Start search_terms. at lib/MT/App.pm line 3291.
2020-05-15T17:37:56 [INFO] Start count. at lib/MT/App/Search.pm line 451.
2020-05-15T17:37:56 [INFO] End count. at lib/MT/App/Search.pm line 451.
2020-05-15T17:37:56 [INFO] S" while reading response header from upstream, client: 46.229.168.148, server: seo.g2soft.net, request: "GET /mt/mt-search.cgi?IncludeBlogs=1&archive_type=Category&category=9&limit=5&page=2&template_id=14 HTTP/1.1", upstream: "fastcgi://unix:/var/run/fcgiwrap.socket:", host: "seo.g2soft.net"
2020/05/15 17:37:56 [error] 861#861: *126285 FastCGI sent in stderr: "tart load_iter. at lib/MT/App/Search.pm line 451.
2020-05-15T17:37:56 [INFO] End load_iter. at lib/MT/App/Search.pm line 451.
2020-05-15T17:37:56 [INFO] End search_terms. at lib/MT/App.pm line 3291.
2020-05-15T17:37:56 [INFO] Start callbacks search_post_execute. at lib/MT/App.pm line 3291.
2020-05-15T17:37:56 [INFO] Search: query for '' at lib/MT/App/Search.pm line 733.
2020-05-15T17:37:56 [INFO] End callbacks search_post_execute. at lib/MT/App.pm line 3291.
2020-05-15T17:37:56" while reading response header from upstream, client: 46.229.168.148, server: seo.g2soft.net, request: "GET /mt/mt-search.cgi?IncludeBlogs=1&archive_type=Category&category=9&limit=5&page=2&template_id=14 HTTP/1.1", upstream: "fastcgi://unix:/var/run/fcgiwrap.socket:", host: "seo.g2soft.net"
2020/05/15 17:37:56 [error] 861#861: *126285 FastCGI sent in stderr: " [INFO] --- End search process. at lib/MT/App.pm line 3291" while reading upstream, client: 46.229.168.148, server: seo.g2soft.net, request: "GET /mt/mt-search.cgi?IncludeBlogs=1&archive_type=Category&category=9&limit=5&page=2&template_id=14 HTTP/1.1", upstream: "fastcgi://unix:/var/run/fcgiwrap.socket:", host: "seo.g2soft.net"
2020/05/15 17:37:57 [error] 861#861: *126288 FastCGI sent in stderr: "2020-05-15T17:37:57 [INFO] --- Start search process. at lib/MT/App.pm line 3291.
2020-05-15T17:37:57 [INFO] --- End search process. Use cache. at lib/MT/App.pm line 3291" while reading upstream, client: 46.229.168.148, server: seo.g2soft.net, request: "GET /mt/mt-search.cgi?IncludeBlogs=1&archive_type=Category&category=9&limit=5&page=2&template_id=14 HTTP/1.1", upstream: "fastcgi://unix:/var/run/fcgiwrap.socket:", host: "seo.g2soft.net"
For some templates it is useful to have direct access to the number of available pages, entries or assets in a given context.
This issue is part of the upcoming separated PR based on #710
Where to get the previous open sourced version under GPL?
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.